0

I had implemented (and tested) transaction operation in redis using multi and exec functionality in a single REDIS instance successfully. However, the same code running in a cluster setup erroring out with the following exception message. I am using spring-data-redis-1.8.1.RELEASE and jedis-2.9.0.

Exception in thread "main" org.springframework.dao.InvalidDataAccessApiUsageException: MUTLI is currently not supported in cluster mode.
    at org.springframework.data.redis.connection.jedis.JedisClusterConnection.multi(JedisClusterConnection.java:2457)
    at org.springframework.data.redis.connection.DefaultStringRedisConnection.multi(DefaultStringRedisConnection.java:608)
    at org.springframework.data.redis.core.RedisTemplate$21.doInRedis(RedisTemplate.java:871)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:207)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:169)
    at org.springframework.data.redis.core.RedisTemplate.multi(RedisTemplate.java:868)
    at com.glu.centech.chat.RedisClusterTest$1.execute(RedisClusterTest.java:58)
    at com.glu.centech.chat.RedisClusterTest$1.execute(RedisClusterTest.java:1)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:229)
    at com.glu.centech.chat.RedisClusterTest.main(RedisClusterTest.java:55)

Is transaction (multi, exec) currently supported in spring data redis in a cluster mode? If so, what am I missing? If not, is there any workaround or when it'll be supported?

buræquete
  • 14,226
  • 4
  • 44
  • 89
Aj last
  • 121
  • 1
  • 2
  • 6

1 Answers1

0

There's no transaction support for Redis Cluster with Spring Data Redis and you should not expect it to be implemented. See Is there any Redis client (Java prefered) which supports transactions on Redis cluster? for further reference.

mp911de
  • 17,546
  • 2
  • 55
  • 95