-
Type: Question
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 5.0.1
-
Component/s: API
-
None
-
Java Drivers
Let`s say I would like to override default connection pool size from 100 to 10.
I will have following piece of code:
`
val clientSettings = MongoClientSettings.builder() .applyToConnectionPoolSettings{
ConnectionPoolSettings.builder().maxSize(10).build() }
.applyConnectionString(ConnectionString(mongoProperties.uri))
.build()
return MongoClients.create(clientSettings)
`
It should set the max size to 10 but instead of I get 100(default value), this value is populated when applyConnectionString is applied to the MongoClientSettings.
Basically it overrides the values that I provided as I understand.
As a workaround I can set: maxPoolSize value to the : mongoProperties.uri and use it without applyToConnectionPoolSettings.