Mongo Connection Pooling(Changing the size of connection pool)

前端 未结 3 403
渐次进展
渐次进展 2021-01-22 22:56

How to change the mongo connection pool size?

I have seen it is 100 by default. Is there a way to change this value?

I dont want to do it via spring, is there a

3条回答
  •  时光取名叫无心
    2021-01-22 23:35

    Extra options can also be set using MongoClientURI :

    MongoClientOptions.Builder builder = new MongoClientOptions.Builder().connectionsPerHost(10));
    MongoClientURI clientURI = new MongoClientURI(connectionURL, builder);
    MongoClient mongoClient = new MongoClient(clientURI);
    

提交回复
热议问题