-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Closed
Copy link
Description
Registering a MessageListener
with RedisMessageListenerContainer
or starting to receive
messages from RedisMessageListenerContainer
requires awaiting until the actual subscription has been registered with Redis. Since subscribing triggers asynchronous activity, the only means to synchronize are sleep timers.
It would be good to actually consume Redis subscription confirmations to [P][UN]SUBSCRIBE
commands through an interface along the lines of:
public interface SubscriptionListener {
SubscriptionListener EMPTY = new SubscriptionListener() {};
default void onChannelSubscribed(byte[] channel, long count) {}
default void onChannelUnsubscribed(byte[] channel, long count) {}
default void onPatternSubscribed(byte[] pattern, long count) {}
default void onPatternUnsubscribed(byte[] pattern, long count) {}
}
It should be possible to let a MessageListener
class implement SubscriptionListener
to bind the actual notifications to the message listener.
hbourada