Persistence (MQLONG)

This indicates whether the message survives system failures and restarts of the queue manager. For the MQPUT and MQPUT1 calls, the value must be one of the following:

    MQPER_PERSISTENT
    The message survives system failures and restarts of the queue manager. Once the message has been put, and the unit of work in which it was put has been committed (if the message is put as part of a unit of work), the message is preserved on auxiliary storage. It remains there until the message is removed from the queue, and the unit of work in which it was got has been committed (if the message is retrieved as part of a unit of work).

    When a persistent message is sent to a remote queue, a store-and-forward mechanism holds the message at each queue manager along the route to the destination, until the message is known to have arrived at the next queue manager.

    Persistent messages cannot be placed on:

    • Temporary dynamic queues
    • Shared queues that map to a CFSTRUCT object at CFLEVEL(2) or below, or where the CFSTRUCT object is defined as RECOVER(NO).
    Persistent messages can be placed on permanent dynamic queues, and predefined queues.

    MQPER_NOT_PERSISTENT
    The message does not usually survive system failures or queue manager restarts. This applies even if an intact copy of the message is found on auxiliary storage when the queue manager restarts.

    In the case of NPMCLASS (HIGH) queues nonpersistent messages survive a normal queue manager shutdown and restart.

    In the case of shared queues, nonpersistent messages survive queue manager restarts in the queue sharing group, but do not survive failures of the coupling facility used to store messages on the shared queues.

    MQPER_PERSISTENCE_AS_Q_DEF

    • If the queue is a cluster queue, the persistence of the message is taken from the DefPersistence attribute defined at the destination queue manager that owns the particular instance of the queue on which the message is placed. Usually, all instances of a cluster queue have the same value for the DefPersistence attribute, although this is not mandated.

      The value of DefPersistence is copied into the Persistence field when the message is placed on the destination queue. If DefPersistence is changed subsequently, messages that have already been placed on the queue are not affected.

    • If the queue is not a cluster queue, the persistence of the message is taken from the DefPersistence attribute defined at the local queue manager, even if the destination queue manager is remote. If there is more than one definition in the queue-name resolution path, the default persistence is taken from the value of this attribute in the first definition in the path. This can be:

      • An alias queue
      • A local queue
      • A local definition of a remote queue
      • A queue manager alias
      • A transmission queue (for example, the DefXmitQName queue)

      The value of DefPersistence is copied into the Persistence field when the message is put. If DefPersistence is changed subsequently, messages that have already been put are not affected.

Both persistent and nonpersistent messages can exist on the same queue.

When replying to a message, applications must use the persistence of the request message for the reply message.

For an MQGET call, the value returned is either MQPER_PERSISTENT or MQPER_NOT_PERSISTENT.

This is an output field for the MQGET call, and an input field for the MQPUT and MQPUT1 calls. The initial value of this field is MQPER_PERSISTENCE_AS_Q_DEF.