Description
Here's the scenario:
B1 = Broker 1
B2 = Broker 2
R1 = Polling Message consumer connected to B1
R2 = Polling Message consumer connected to B2
S1 = Message producer connected to B1
B1 and B2 are started – they find each other and "hookup"
R1 and R2 are started – they connect and call receive() on Q
S1 is started – connects and sends 10 messages to Q.
R1 receives messages: 0,2,4,6,8
R2 receives messages: 1,3,5,7,9
Restart R1 (complete shutdown of JVM) — here's where the bug starts showing
R1 receives messages: 3,7
R2 receives messages: 1,5,9
Restart R2 (complete shutdown of JVM) — nothing happens (no
messages are redelivered)
Restart R1
R1 receives messages: 5
R2 receives messages: 1,9
Restart R1
R1 receives messages: 9
R2 receives messages: 1
Restart R1
R1 receives messages: <nothing>
R2 receives messages: 1
And if you keep restarting R1 the final loop happens over and over again.
I'll attach a sample with instructions on how to run it.