MsgDeliverySequence (MQLONG)
Local |
Model |
Alias |
Remote |
Cluster |
Yes |
Yes |
No |
No |
No |
This determines the order in which the MQGET call
returns messages to the application :
- MQMDS_FIFO
- Messages are returned in FIFO order (first in, first out).
An MQGET call returns the first message
that satisfies the selection criteria specified on the call, regardless of
the priority of the message.
- MQMDS_PRIORITY
- Messages are returned in priority order.
An MQGET call returns the highest-priority message that
satisfies the selection criteria specified on the call. Within each priority
level, messages are returned in FIFO order (first in, first out).
- On z/OS, if the queue has an IndexType of MQIT_GROUP_ID,
the MsgDeliverySequence attribute specifies the order
in which message groups are returned to the application. The particular sequence
in which the groups are returned is determined by the position or priority
of the first message in each group. The physical order of messages on the
queue is not defined, as the queue is optimized for efficient retrieval of
messages using the MQGMO_LOGICAL_ORDER option on the MQGET call.
- On z/OS, if IndexType is MQIT_GROUP_ID and MsgDeliverySequence is MQMDS_PRIORITY, the queue manager uses message
priorities zero and one to optimize the retrieval of messages in logical order.
As a result, the first message in a group must not have a priority of zero
or one; if it does, the message is processed as though it had a priority of
two. The Priority field in the MQMD structure is not changed.
If the relevant attributes are changed while there are messages on the
queue, the delivery sequence is as follows:
- The order in which messages are returned by the MQGET call is determined by the values of the MsgDeliverySequence and DefPriority attributes in force for the
queue at the time that the message arrives on the queue:
- If MsgDeliverySequence is MQMDS_FIFO when the message
arrives, the message is placed on the queue as though its priority were DefPriority. This does not affect the value of the Priority field in the message descriptor of the message; that field retains
the value it had when the message was first put.
- If MsgDeliverySequence is MQMDS_PRIORITY when the
message arrives, the message is placed on the queue at the place appropriate
to the priority given by the Priority field in the message
descriptor.
If the value of the MsgDeliverySequence attribute
is changed while there are messages on the queue, the order of the messages
on the queue is not changed.
If the value of the DefPriority attribute is changed while there are messages on the queue, the
messages are not necessarily delivered in FIFO order, even though the MsgDeliverySequence attribute is set to MQMDS_FIFO; those that
were placed on the queue at the higher priority are delivered first.
To determine the value of this attribute, use the MQIA_MSG_DELIVERY_SEQUENCE
selector with the MQINQ call.