We are using Ektorp from WebSphere Liberty Profile to access our CouchDB databases. We are using the 'couchdb-1.0' feature of WLP, and the WLP 'server.xml' 'couchdb' element to declare the options, and dependency injection to get an instance of the related CouchDbInstance.
<couchdb id="cmsCouchDb"
jndiName="${couchdb.jndi}"
libraryRef="couchdb-lib"
password="${couchdb.password}"
port="${couchdb.port}"
url="${couchdb.url}"
username="${couchdb.user}"/>
@Resource(lookup = YOURIBM_CONTENT_MGMT_DATABASE_JNDI)
private CouchDbInstance couchDbInstance;
This works fine for us. However, now we want to be able to set the 'connectionTimeout' and 'socketTimeout' values for the HTTP connection. I thought possibly I could just add those options into the 'couchdb' element (I came to this conclusion because I opened up the CouchDBService class from the WLP 'couchdb-1.0' feature in an editor, and in addition to the options we already have set above, those timeout options were in the same place in the class). But when I set them there, it made no difference.
From what I can tell, in order for us to set those timeouts, we will no longer be able to use injection or JNDI lookup, but will need to set all of the parameters from WLP's 'server.xml' ourselves in our code, as we create a new CouchDbInstance object.
I'm hoping that I'm wrong, and there's an easier way to do that. Is there? Any ideas?