[JAVA-379] MongURI should allow configuring of the socketKeepAlive setting in the driver Created: 13/Jun/11  Updated: 29/Oct/17  Resolved: 29/Oct/17

Status: Closed
Project: Java Driver
Component/s: Configuration, Connection Management
Affects Version/s: 2.6.3
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Paul D. Walker Assignee: Unassigned
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

java driver


Issue Links:
Related
related to JAVA-2531 Have TCP keepalive default to true Closed
Backwards Compatibility: Fully Compatible

 Description   

MongoOptions.java supports the enabling of socket keep alive, yet the option is not accessible through MongoURI.java. Is there a specific reason for this? or can the option be enabled by adding the following code to MongoURI.java in the parseOptions method?

(after line 171 in v2.6.3 of MongoURI.java)
else if ( key.equals( "socketKeepAlive" ) ) _options.autoConnectRetry = _parseBoolean( value );



 Comments   
Comment by Jeffrey Yemin [ 29/Oct/17 ]

In JAVA-2531 we changed the default for TCP keepalive to true and deprecated the option, so closing this as won't fix.

Comment by Jeffrey Yemin [ 12/Jul/13 ]

Note that with MongoClientURI you can combine the URI with an instance of MongoClientOptions.Builder, e.g.

        MongoClientURI uri = new MongoClientURI("mongodb://localhost/?maxPoolSize=150",
                MongoClientOptions.builder().socketKeepAlive(true));

Comment by Scott Hernandez (Inactive) [ 13/Jun/11 ]

To enable language specific URI options we are going with a language prefix: javaAutoConnectRetry for example.

Generated at Thu Feb 08 08:52:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.