Hi, I am newbie to java itself and I am trying to access Redis using Lettuce but I was wondering is there is a sample Lettuce code which would look into existing open connections from same connecting client and reuse them, rather then creating connection , closing them. I am trying to a POC but once successful, we would hit redis a 100K times easily setting & getting values.
The client which will call redis will sit on the same server (as localhost) but will run as a different user. Hence wanted to know if there is an example code for connection polling or reuse connection which are already established.
Simple code which works
---------------------------------------
RedisClient client = new RedisClient("localhost");
RedisConnection<String, String> connection = client.connect();
String value=connection.get("key2");
connection.close();
client.shutdown();
What I do see on the client is a connection which was opened from my client PC, but I am not able to reuse this connection
127.0.0.1:6379> client list
id=170 addr=XX.XX.XX.153:55310 fd=6 name= age=258513 idle=258513 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=exec
Also when executed from the server I keep getting this warning. Will the connection polling also allocate a thread size and handle them efficiently.
Jul 15, 2016 2:41:53 PM com.lambdaworks.redis.resource.DefaultClientResources <init>
INFO: ioThreadPoolSize is less than 3 (2), setting to: 3
Jul 15, 2016 2:41:53 PM com.lambdaworks.redis.resource.DefaultClientResources <init>
INFO: computationThreadPoolSize is less than 3 (2), setting to: 3
Connected to Redis - Successful
Any help on this would be greatly appreciated