Hi, I try to migrate mongodb-java-driver-legacy to mongodb-java-driver-sync, but I can found connection-per-host option in mongo client settings.
how can i migrate that option?
Thx!
Hi, I try to migrate mongodb-java-driver-legacy to mongodb-java-driver-sync, but I can found connection-per-host option in mongo client settings.
how can i migrate that option?
Thx!
It’s the maxSize
property on ConnectionPoolSettings
, e.g.
var settings = MongoClientSettings.builder()
.applyConnectionString(new ConnectionString("<your connection string>"))
.applyToConnectionPoolSettings(builder ->
.maxSize(200)
.build()