Ektorp and WebSphere Liberty Profile Question

24 views
Skip to first unread message

Dave Westerman

unread,
Mar 2, 2016, 1:33:38 AM3/2/16
to ektorp-discuss
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?

Henrik Lundgren

unread,
Mar 3, 2016, 2:39:31 AM3/3/16
to ektorp-...@googlegroups.com
I would guess that the couchdb-1.0 feature in WLP does not map those settings onto the actual CouchDbInstance.
You could ask the developers of that feature what to do.

If you are using CDI you could expose a CouchDbInstance through a bean factory, using the @Produces annotation for instance, personally I try to stay away from JNDI as long as I possibly can :-)

/Henrik

--
You received this message because you are subscribed to the Google Groups "ektorp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ektorp-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages