RedisPubSubTopicListenerWrapper<M> pubSubListener = new RedisPubSubTopicListenerWrapper<M>(listener, getName());
return addListener(pubSubListener);
}
private int addListener(RedisPubSubTopicListenerWrapper<M> pubSubListener) {
PubSubConnectionEntry entry = connectionManager.subscribe(getName());
synchronized (entry) {
if (entry.isActive()) {
entry.addListener(getName(), pubSubListener);
return pubSubListener.hashCode();
}
}
// entry is inactive trying add again
return addListener(pubSubListener);