0
votes

i have a topic and i post a message to the topic note: I stopped all JMS queue listeners. Now i restart the server now this time with listeners on, i was expecting the system to consume my previously posted message. But it didn't happen that way.

i have read the documentation of JBOSS - hornetq it says all the JMS messages are persistent in nature.How can i demonstrate that messages are persistent in nature? Messages should have been consumed in the second run; as the message would have been in some persistent database of the messaging queue.

http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html

the document says that it persistent JMS message can survive a broker restart, My question mean can persistent JMS message survive a listener restart, if not how can i acheive it?

1

1 Answers

0
votes

I think you're simply experiencing the normal semantics of a JMS topic. Here's a few things to keep in mind:

  1. Any message sent to a topic is placed in the matching subscription(s) on that topic. If there are no matching subscriptions on the topic then the message is discarded.
  2. Topic subscriptions are not durable by default and any messages in a non-durable subscription are discarded when the subscriber disconnects.
  3. In order for messages sent to a topic to survive a broker restart the subscription must be durable and the message must be persistent.