Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2222

How to pub/sub message to Redis cluster

$
0
0

My project is using Redis (Jedis client) as cache manager. here is bean i use to manipulate connection to redis cluster

@Bean(destroyMethod = "close")    @ConditionalOnProperty(value = "spring.cache.type", havingValue = "redis")    public JedisCluster jedisCluster(@Value("${spring.redis.host}") String host,                                     @Value("${spring.redis.port}") int port,                                     @Value("${spring.redis.password}") String password) {        Set<HostAndPort> jedisClusterNode = new HashSet<>();        jedisClusterNode.add(new HostAndPort(host, port));        JedisPoolConfig defaultConfig = new JedisPoolConfig()        return new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT,                DEFAULT_REDIRECTIONS, kcService.getKey(password), "lhs_redis", defaultConfig);    }

Now i want to use pub/sub feature of Redis, base on this link https://medium.com/@bhanuchaddha/using-redis-pub-sub-with-spring-boot-ea0d7a8c27af look like they can do for standalone redis.

So anybody know how to set up Pub/Sub for Redis cluster ?

thanks


Viewing all articles
Browse latest Browse all 2222


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>