IBM Support

Message persistence FAQs

Question & Answer


Question

This is intended to answer frequently asked questions regarding WebSphere MQ handling of persistent and nonpersistent messages. Q1. Why do messages get discarded at restart? Q2. Why do messages survive a restart? Q3. What is the best way to be certain that messages are persistent? Q4. If you send nonpersistent message over a fast channel and the channel fails, can you lose your messages?

Answer

A1. Nonpersistent messages do not survive restarts because they are considered to be nonessential messages. However the queue attribute NPMCLASS(HIGH) can change the treatment of non-persistent messages (see details below).

A2. Persistent messages survive system restarts because they are considered to be essential messages. If the data in a message is important to your business, then you should always make your messages persistent.

A3. Set MQMD message persistence to persistent (MQPER_PERSISTENT), or nonpersistent (MQPER_NOT_PERSISTENT) and your message will always retain that value.

Note: MQPER_PERSISTENCE_AS_Q_DEF is the default setting for the persistence value in the MQMD. See the persistence values listed below.

A4. Yes, you can lose nonpersistent messages on a fast channel because they are not logged.


Effect of message persistence
  • Persistent messages are logged. Logging messages reduces the performance of your application, so you should use persistent messages for essential data only.
  • If the data in a message can be discarded when a queue manager stops or fails, use a nonpersistent message.


MQPER_* (Persistence Values)

MQPER_NOT_PERSISTENT
0
X'00000000'
MQPER_PERSISTENT
1
X'00000001'
MQPER_PERSISTENCE_AS_Q_DEF
2
X'00000002'


Diagnostic hints and tips:

  1. If you suspect that you are losing messages, or if you want to verify the persistence setting for your application's messages. Trace your application putting a message to the destination queue, or browse messages on the queue.
  2. Examine the MQMD - Message descriptor fields and verify the persistence setting.
  3. The queue attribute NPMCLASS(HIGH) can change the treatment of non-persistent messages on a 'normal' queue manager restart. The queue manager attempts to retain non-persistent messages on this queue over a queue manager restart. Note that you cannot set this parameter on z/OS.


Additional information

MQPER_PERSISTENCE_AS_Q_DEF can lead to unexpected results. If there is more than one definition in the queue-name resolution path, the default persistence attribute is taken from first queue definition in the path at the time of the MQPUT or MQPUT1 call. This queue could be an:

  • alias queue
  • local queue
  • local definition of a remote queue
  • queue-manager alias
  • transmission queue
  • cluster queue

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Configuration","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF021","label":"OpenVMS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.0;7.5;7.1;7.0.1;7.0;6.0;5.3.1;5.3","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WMQ MQ

Document Information

Modified date:
15 June 2018

UID

swg21231054