Java Driver
  1. Java Driver
  2. JAVA-710

Support max connection idle time and max connection life time

    Details

    • # Replies:
      9
    • Last comment by Customer:
      false

      Description

      We are using the 2.10.1 version of the java driver and idle connections are not getting timed out. Please provide support of maxIdleTimeMS property in the java driver or let us know if there a reason this is not implemented.

      http://docs.mongodb.org/manual/reference/connection-string/#maxIdleTimeMS

      Implementation:

      In MongoClientOptions, the property names are maxConnectionIdleTIme and maxConnectionLifeTime. In MongoClientURI, the query parameter names are maxIdleTimeMS and maxLifeTimeMS.

        Issue Links

          Activity

          Hide
          Jeff Yemin
          added a comment -

          Actually, still need to expose these settings via MongoClient, so re-opening

          Show
          Jeff Yemin
          added a comment - Actually, still need to expose these settings via MongoClient, so re-opening
          Hide
          Jeff Yemin
          added a comment -

          Added maxConnectionIdleTime and maxConnectionLifeTime properties to MongoClientOptions.
          Added maxIdleTimeMS and maxLifeTimeMS to MongoClientURI.

          Show
          Jeff Yemin
          added a comment - Added maxConnectionIdleTime and maxConnectionLifeTime properties to MongoClientOptions. Added maxIdleTimeMS and maxLifeTimeMS to MongoClientURI.
          Hide
          Eyllo
          added a comment - - edited

          Any ideas when this will hit trunk? We are desperate for using this as we have deployed inside Azure and are fighting to stay on the game.
          Thanks!

          Show
          Eyllo
          added a comment - - edited Any ideas when this will hit trunk? We are desperate for using this as we have deployed inside Azure and are fighting to stay on the game. Thanks!
          Hide
          Jeff Yemin
          added a comment -

          I just pushed the code to master and also pushed a snapshot to Sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/mongodb/mongo-java-driver/2.12.0-SNAPSHOT/mongo-java-driver-2.12.0-20131126.005249-6.jar.

          Please give it a try and let us know how it's working for you.

          Show
          Jeff Yemin
          added a comment - I just pushed the code to master and also pushed a snapshot to Sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/mongodb/mongo-java-driver/2.12.0-SNAPSHOT/mongo-java-driver-2.12.0-20131126.005249-6.jar . Please give it a try and let us know how it's working for you.
          Hide
          Jeff Yemin
          added a comment -

          Hi there,

          Interested parties can test the fix with 2.12.0-rc0, available either on github or Maven Central. Any takers?

          Thanks,
          Jeff

          Show
          Jeff Yemin
          added a comment - Hi there, Interested parties can test the fix with 2.12.0-rc0, available either on github or Maven Central . Any takers? Thanks, Jeff
          Hide
          Alexej Kubarev
          added a comment -

          Going to test this together with the JAVA-1117 on your latest snapshot

          Show
          Alexej Kubarev
          added a comment - Going to test this together with the JAVA-1117 on your latest snapshot
          Hide
          Alexej Kubarev
          added a comment -

          Hi Jeff, was trying to configure the Connection Idle time via the URI options (as part of the uri string) and it seems that this is not supported still?
          Tried both maxConnectionIdleTime and maxIdleTimeMS and getting warning about unsupported option.

          This is pretty understandable as i cant find those options in the source.
          Maybe Im missing something?

          Show
          Alexej Kubarev
          added a comment - Hi Jeff, was trying to configure the Connection Idle time via the URI options (as part of the uri string) and it seems that this is not supported still? Tried both maxConnectionIdleTime and maxIdleTimeMS and getting warning about unsupported option. This is pretty understandable as i cant find those options in the source. Maybe Im missing something?
          Hide
          Jeff Yemin
          added a comment -

          Hi Alexej,

          No, you're not missing anything. Thanks for catching this. I neglected to add support in the URI for these options. I'm working on it today, but until then you can only test using MongoClientOptions.

          Thanks,
          Jeff

          Show
          Jeff Yemin
          added a comment - Hi Alexej, No, you're not missing anything. Thanks for catching this. I neglected to add support in the URI for these options. I'm working on it today, but until then you can only test using MongoClientOptions. Thanks, Jeff
          Hide
          Jeff Yemin
          added a comment -

          Hi Alexej,

          URI support is available in the latest snapshot, available here, if you'd like to test that. I documented the query parameter names in the description.

          Thanks,
          Jeff

          Show
          Jeff Yemin
          added a comment - Hi Alexej, URI support is available in the latest snapshot, available here , if you'd like to test that. I documented the query parameter names in the description. Thanks, Jeff

            People

            • Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                6 weeks, 6 days ago
                Date of 1st Reply: