I have this redis configuration class which sets the transaction support to True. The redis is in a clustered mode. When the application calls this haskey method, the application returns the following error:
org.springframework.dao.InvalidDataAccessApiUsageException: MULTI is currently not supported in cluster mode.
public boolean hasKey(String key) { return redisTemplate.hasKey(key); }
@Configuration@RefreshScopepublic class RedisConfiguration { @Bean public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) { final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>(); redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setHashKeySerializer(new GenericToStringSerializer<Object>(Object.class)); redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer()); redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer()); redisTemplate.setConnectionFactory(connectionFactory); redisTemplate.setEnableTransactionSupport(true); return redisTemplate; }}
If I put setEnableTransactionSupport to false, the haskey method does not throw error anymore. May I know if transaction support is available for clustered redis?