diff --git a/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/javadsl/R2dbcSession.scala b/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/javadsl/R2dbcSession.scala index 8627a9e05..b47b3a434 100644 --- a/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/javadsl/R2dbcSession.scala +++ b/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/javadsl/R2dbcSession.scala @@ -42,14 +42,13 @@ object R2dbcSession { }.asJava /** - * Provide a custom connectionFactory and an optional config path to load closeCallsExceeding from. + * Provide a custom connectionFactory. The config closeCallsExceeding is loaded from the default path. */ def withSession[A]( system: ActorSystem[_], connectionFactory: ConnectionFactory, - configPath: Optional[String], fun: JFunction[R2dbcSession, CompletionStage[A]]): CompletionStage[A] = { - scaladsl.R2dbcSession.withSession(system, connectionFactory, configPath.toScala) { scaladslSession => + scaladsl.R2dbcSession.withSession(system, connectionFactory) { scaladslSession => val javadslSession = new R2dbcSession(scaladslSession.connection)(system.executionContext, system) fun(javadslSession).asScala } diff --git a/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/scaladsl/R2dbcSession.scala b/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/scaladsl/R2dbcSession.scala index 43f65394a..42f331ed1 100644 --- a/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/scaladsl/R2dbcSession.scala +++ b/akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/scaladsl/R2dbcSession.scala @@ -38,15 +38,15 @@ object R2dbcSession { fun: R2dbcSession => Future[A]): Future[A] = { val connectionFactoryProvider = ConnectionFactoryProvider(system) val connectionFactory = connectionFactoryProvider.connectionFactoryFor(connectionFactoryConfigPath) - withSession(system, connectionFactory, Some(connectionFactoryConfigPath))(fun) + withSession(system, connectionFactory)(fun) } /** - * Provide a custom connectionFactory and an optional config path to load closeCallsExceeding from. + * Provide a custom connectionFactory. The config closeCallsExceeding is loaded from the default path. */ - def withSession[A](system: ActorSystem[_], connectionFactory: ConnectionFactory, configPath: Option[String])( + def withSession[A](system: ActorSystem[_], connectionFactory: ConnectionFactory)( fun: R2dbcSession => Future[A]): Future[A] = { - val poolConfig = system.settings.config.getConfig(configPath.getOrElse(connectionFactoryConfigPath(system))) + val poolConfig = system.settings.config.getConfig(connectionFactoryConfigPath(system)) val poolSettings = new ConnectionPoolSettings(poolConfig) val r2dbcExecutor = new R2dbcExecutor(connectionFactory, log, logDbCallsDisabled, poolSettings.closeCallsExceeding)(