Premraj
Premraj

Reputation: 74661

How do I get the lost messages when my MQ Server was down

How do you get lost messages when MQ Server was down?
How do you make sure messages should not lost event though MQ is down?

Upvotes: 2

Views: 2530

Answers (2)

Shashi
Shashi

Reputation: 15283

When MQ server is down, nothing can be done, neither put nor get messages. To get or put messages, MQ server must be up and running.

Messages are of two types, Persistent and non-persistent messages. Non-persistent messages are lost when the MQ server goes down. These can not be recovered. Persistent messages are not lost even if the server goes down as they are saved to a storage and retrieved when server comes up. In WebSphere MQ world, there is a third type, Semi-persistent. This type of messages are not lost if the server is shutdown gracefully.

You can read more on WebSphere MQ here: http://www.redbooks.ibm.com/redpapers/pdfs/redp0021.pdf and InfoCenter: http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp

Upvotes: 1

tonga
tonga

Reputation: 11981

JMS messages can be delivered in two modes: Persistent and Non-persistent modes. In persistent mode, messages are stored to database/permanent storage so that the message will not get lost in case of provider shutdown/failure. With persistent mode, messages can be retrieved when the provider goes back to service. The default mode is Persistent mode. You can use setDeliveryMode method in MessageProducer class to set the JMS delivery mode. For more details please refer to:

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

Upvotes: 2

Related Questions