Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
2.10.1
-
Software
-
Fully Compatible
Description
Team,
I'm trying to create two instance of Mongo with different MongoOptions as the need is to connect to two different database within the same mongo host but with different connection parameters.
But only one instance of MongoOption is created and only one of the possible connection parameters are set as the other one gets overridden during the second Mongo instance initialization.
Is there a way to create two different instances of MongoOptions?
The configuration is given below.
<mongo:mongo replica-set="${mongo.host}" id="apiMongo">
<mongo:options connections-per-host="8"
threads-allowed-to-block-for-connection-multiplier="2"
connect-timeout="12000"
max-wait-time="12000"
auto-connect-retry="true"
socket-keep-alive="true"
socket-timeout="120000"
/>
</mongo:mongo>
<mongo:mongo replica-set="${mongo.host}" id="systemMongo">
<mongo:options connections-per-host="8"
threads-allowed-to-block-for-connection-multiplier="2"
connect-timeout="2000"
max-wait-time="2000"
auto-connect-retry="true"
socket-keep-alive="true"
socket-timeout="2000"
/>
</mongo:mongo>
Two instances of Mongo is created and they both point to a single instance of MongoOptions. Is there a way to create multiple instances of MongoOption?