I'm using Spring Data Redis with Redis Sentinel and subscribe to keyspace event notifications. How to detect when a switch to a new master occurs as a result of a failover so that I can resubscribe to the required channels?
There is no need to manually detect failovers and resubscribe to channels when that happens, since Lettuce does that by itself (see StatefulRedisPubSubConnectionImpl#activated()
).