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

Spring Boot Redis(cluster sentinel) is this possible to get published message in subscribed client after reconnect?

$
0
0

I am using Redis(cluster sentinel) for the pub/sub mechanism.

I have an issue with the subscription client when there is the master pod gets down and another becomes master that time someone is publishing the message on the channel and some messages get lost how to recover those messages?

Following is my code

RedisSentinelConfiguration sentinelConfig = new RedisSentinelConfiguration().master("mymaster");        sentinelConfig.sentinel(host, Integer.parseInt(port));        return new LettuceConnectionFactory(sentinelConfig, LettuceClientConfiguration.builder().readFrom(ReadFrom.REPLICA_PREFERRED).build());

subscription client.

@Autowired    private ReactiveRedisOperations<String, String> reactiveRedisTemplate;reactiveRedisTemplate.listenTo(ChannelTopic.of("some_channel")).subscribe(data -> {});

Viewing all articles
Browse latest Browse all 2204

Trending Articles



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