MDPRI (10-digit signed integer)

Message priority.

For the MQPUT and MQPUT1 calls, the value must be greater than or equal to zero; zero is the lowest priority. The following special value can also be used:

PRQDEF

Default priority for queue.

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

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

  • If the queue is not a cluster queue, the priority for the message is taken from the DefPriority attribute as 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 priority is taken from the value of this attribute in the first definition in the path. This could be:

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

The value returned by the MQGET call is always greater than or equal to zero; the value PRQDEF is never returned.

If a message is put with a priority greater than the maximum supported by the local queue manager (this maximum is given by the MaxPriority queue manager attribute), the message is accepted by the queue manager, but placed on the queue at the queue manager's maximum priority; the MQPUT or MQPUT1 call completes with CCWARN and reason code RC2049. However, the MDPRI field retains the value specified by the application which put the message.

When replying to a message, applications should normally use for the reply message the priority of the request message. In other situations, specifying PRQDEF allows priority tuning to be carried out without changing the application.

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 PRQDEF.