Jedis to JedisCluster migration for AWS Elastic Cache

Skip to first unread message

Rajkumar Patange

Jul 21, 2021, 10:07:41 AM7/21/21
to Jedis
Hi Team,
Need input regarding JedisCluster, our old implementation was using Jedis Client which had inbuilt support for Transaction and Scan, we are migrating to AWS Elastic Cache which means we need to shift to JedisCluster( I need some reference related to JedisCluster support for Transaction & SCAN.

Thank you

Sazzadul Hoque

Jul 28, 2021, 3:58:45 AM7/28/21
Hi Rajkumar Patange,

It is not possible to support Transaction in Cluster mode. But it is possible to do Transaction on a hashslot with very little extra work.

JedisCluster already supports SCAN by hashtag. Again, overall scan is not supported by Redis Cluster itself.

PS: Your email was sent to spam by Gmail.

You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Rajkumar Patange

Jul 28, 2021, 4:44:40 AM7/28/21
to Jedis
Thanks for confirmation. The transaction implemented below way : 
Jedis jedisNodeConnection= jedisCluster.getConnectionFromSlot(JedisClusterCRC16.getSlot(hashKey(key)));;
Transaction transaction = jedisNodeConnection.multi();
transaction.set(hashKey(key), String.valueOf(item));
Let me know if there is any better way.

Sazzadul Hoque

Jul 28, 2021, 8:10:09 AM7/28/21
It's a good Transaction implementation.

My two cents:
- I don't see the necessity of Transaction for only one operation.
- UNWATCH is unnecessary after EXEC.

Rajkumar Patange

Jul 28, 2021, 8:14:35 AM7/28/21
to Jedis
Thanks. Removed unwatch.  Yes , the transaction is not required for one operation we have multiple operations this was an example snippet . 
Reply all
Reply to author
0 new messages