Message persistence FAQs

Technote (FAQ)


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 Alias/Synonym

WMQ MQ

Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere MQ
Configuration

Software version:

5.3, 5.3.1, 6.0, 7.0, 7.0.1, 7.1, 7.5

Operating system(s):

AIX, HP-UX, Linux, OpenVMS, Solaris, Windows, z/OS

Reference #:

1231054

Modified date:

2014-01-28

Translate my page

Machine Translation

Content navigation