This works just fine given that the client has to reconnect to a different server anyway. However I would suggest depending on how Jedis handles it you have the subscribers attempt to reconnect on a shorter interval than the master. This will help decrease the chance of lost messages should the publisher publish a message to the new master before a subscriber does.
I've been doing some client testing in the specific area and can confirm that if the client handles the reconnect properly and the publisher(s) connect after the subscribers it works just fine. At least with the libraries I've tested so far. Given I don't know Java I can't comment on whether Jedis handles it properly.
If it is absolutely critical that no messages are lost you would need to either implement some form of quorum to know that all needed subscribers are reconnected before resuming publishing, or use something akin to a queue rather than pub sub. Whether that is feasible will depend on your specific requirements and environment. Redis' pub sub makes no persistence or delivery guarantees at all. It does however know how many clients received a message. With that information it is possible to implement retry on your own in the client side code if the recipient count isn't where you need it to be (such as 0 for example).
Cheers,
Bill
As such whetherit is sentinel, manual, or with a proxy in front the client has to detect the failover (via reconnect at the minimum) and re-establish the pub sub setup.
Cheers,
Bill