Multiple Mongo Instances always have the same MongoOption Reference

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.10.1
    • Component/s: Connection Management
    • Environment:
      Software
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      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?

            Assignee:
            Unassigned
            Reporter:
            Sulbigar Shanawaz
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: