Java Library - best practice

Henning Verbeek hankipanky at gmail.com
Mon May 26 06:44:14 EDT 2014


I'd like to get some advice how best to handle clients in a
multi-threaded Java application. Riak is 1.4.8, java client library is
1.4.4, using the protocol buffers clients.

I'm referring specifically to
http://basho.github.io/riak-java-client/1.4.4/com/basho/riak/client/RiakFactory.html#newClient(com.basho.riak.client.raw.config.Configuration).
Should I use one single instance of IRiakClient per JVM and share it
between all threads that access Riak? Or should each thread obtain its
own, new client instance when needed and terminate it again
afterwards?

If the PBConfiguration specifies a poolSize, is that being handled in
the Factory?

Thanks, Henning




More information about the riak-users mailing list