-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom connection factory when using withSession #1271
feat: custom connection factory when using withSession #1271
Conversation
/** | ||
* Provide a custom connectionFactory and an optional config path to load closeCallsExceeding from. | ||
*/ | ||
def withSession[A](system: ActorSystem[_], connectionFactory: ConnectionFactory, configPath: Option[String])( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have configPath in this one. It's only used for closeCallsExceeding and we can instead take that from the default connectionFactoryConfigPath.
@@ -37,7 +38,16 @@ object R2dbcSession { | |||
fun: R2dbcSession => Future[A]): Future[A] = { | |||
val connectionFactoryProvider = ConnectionFactoryProvider(system) | |||
val connectionFactory = connectionFactoryProvider.connectionFactoryFor(connectionFactoryConfigPath) | |||
val poolSettings = new ConnectionPoolSettings(system.settings.config.getConfig(connectionFactoryConfigPath)) | |||
withSession(system, connectionFactory)(fun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it should still use the poolSettings.closeCallsExceeding
from the given connectionFactoryConfigPath
akka-projection-r2dbc/src/main/scala/akka/projection/r2dbc/scaladsl/R2dbcSession.scala
Outdated
Show resolved
Hide resolved
…ladsl/R2dbcSession.scala Co-authored-by: Patrik Nordwall <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Follow up to #1254