Fix messages not received if listening on channel and pattern

DATAREDIS-165

Infinite loop in PatternSubscriptionTask causing
broken pipes and unreceived messages
This commit is contained in:
Jennifer Hickey
2013-04-04 11:26:12 -07:00
parent 78ad1a7cd4
commit 2291edae67
2 changed files with 29 additions and 1 deletions

View File

@@ -662,7 +662,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
// wait for subscription to be initialized
boolean done = false;
// wait 3 rounds for subscription to be initialized
for (int i = 0; i < ROUNDS || done; i++) {
for (int i = 0; i < ROUNDS && !done; i++) {
if (connection != null) {
synchronized (localMonitor) {
if (connection != null && connection.isSubscribed()) {