Search code examples
springjmsactivemq-classicjmstemplate

ACTIVEMQ - How can subscriber receive topic messages when started after publisher?


In my program, I have two modules :- Publisher and Subscriber which communicate via Topic.

I understand that in order to receive messages by subscriber, it should be started before publisher. But there may be a scenario where the subscriber goes down for some reason and needs to be restarted. Is there any way, by which if I start the Subscriber after Publisher, then also it should be able to receive message?


Solution

  • If you are only interested in the disconnect-reconnect scenario, I think a durable subscriber is what you are looking for.

    http://activemq.apache.org/how-do-durable-queues-and-topics-work.html