Best practice to use JedisSentinelPool

1,040 views
Skip to first unread message

Roshan Pradeep

unread,
Apr 22, 2015, 8:59:02 AM4/22/15
to jedis...@googlegroups.com
Hi 

I am using latest Jedis (2.7.0) with Redis 3.0.0 version on Master/Slave mode.

I just want to know what is the best suitable way to get a resource from the pool. At the moment my coding is:

jedisSentinelPool = new JedisSentinelPool(MASTER_NAME, sentinels);
jedis = jedisSentinelPool.getResource();

My jedis instance is singleton through out the application and is this the right way? Or do I need to get a resource every time when I need to do a get/set?

Thanks

Roshan

Marcos NiLs

unread,
Apr 22, 2015, 9:38:06 AM4/22/15
to jedis...@googlegroups.com
Rosha, you should get a resource every time you need to make an operation to redis. 

You can check how to use it in the wiki:



Best, 

Marcos
Reply all
Reply to author
Forward
0 new messages