[JAVA-710] Support max connection idle time and max connection life time Created: 09/Dec/12 Updated: 06/Apr/23 Resolved: 26/Nov/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.10.1 |
| Fix Version/s: | 2.12.0, 3.0.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Syam Raj | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 6 |
| Labels: | driver | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||
| 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. |
| Comments |
| Comment by Jeffrey Yemin [ 27/Feb/14 ] |
|
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, |
| Comment by Jeffrey Yemin [ 27/Feb/14 ] |
|
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, |
| Comment by Alexej Kubarev [ 27/Feb/14 ] |
|
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? This is pretty understandable as i cant find those options in the source. |
| Comment by Alexej Kubarev [ 27/Feb/14 ] |
|
Going to test this together with the |
| Comment by Jeffrey Yemin [ 27/Feb/14 ] |
|
Hi there, Interested parties can test the fix with 2.12.0-rc0, available either on github or Maven Central. Any takers? Thanks, |
| Comment by Jeffrey Yemin [ 26/Nov/13 ] |
|
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. |
| Comment by Eyllo [ 25/Nov/13 ] |
|
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. |
| Comment by Jeffrey Yemin [ 09/Aug/13 ] |
|
Added maxConnectionIdleTime and maxConnectionLifeTime properties to MongoClientOptions. |
| Comment by Jeffrey Yemin [ 12/Jul/13 ] |
|
Actually, still need to expose these settings via MongoClient, so re-opening |