1

Using activeMQ as a medium to communicate data between modules. Have Producer P, Subscribers S1 S2 to read from P. Using Queue as a dataset to dispatch data in Round Robin fashion. S1, S2 are receiving data as expected. Having S1, S2 is to achieve fail-safe and load balancing. ACK is sent after the data is processed, in order to make sure we don't miss any data from P.

Observed a scenario where S1 is down with some data read and not processed completely(so, no ACK is sent yet). I was expecting ActiveMQ to re-sent(un-ACK'ed) data to S2. Ofcourse, data is dispatched to S1 on a restart. But time frame is important too.

Help me understand to achieve the mechanism. Appreciate the help.

srikanth
  • 958
  • 16
  • 37

1 Answers1

1

... where S1 is down... I was expecting ActiveMQ to re-sent(un-ACK'ed) data to S2

And this is not happening? When you say S1 is down, do you mean it's actually shut down, or do you mean it's just unable to process any messages because it's hanging?

In the latter case, the behaviour you're seeing is by design - as long as S1 is still connected the broker will not release messages in S1's prefetch buffer (at least until message expiry timeout is hit).

In the former case, S1's queue connection keep-alive timeout will be hit (after a configurable time), and all message in S1's prefetch should be rolled back to the broker and made available for S2 to process.

tom redfern
  • 30,562
  • 14
  • 91
  • 126