Home

 

MsgToken (MQBYTE16)

This is a byte string that is generated by the queue manager to identify a message uniquely. The message token is generated when the message is first placed on the queue manager, and remains with the message until the message is permanently removed from the queue manager, unless the queue manager is restarted. The message token might persist across a queue manager restart, but the same token is not used to identify a different message. The token is local to the queue manager that generates it, and does not travel with the message when the message flows between queue managers. As a result, a particular message has a different message token on each of the queue managers that it visits.

For the MQGET call, MsgToken is one of the fields that we can use to select a particular message to be retrieved from the queue. Normally the MQGET call returns the next message on the queue, but we can get a message with a particular message token by setting the MsgToken field to the value required and specifying the MQMO_MATCH_MSG_TOKEN option in the MatchOptions field.

Notes:

  1. We can specify MQMO_MATCH_MSG_TOKEN whatever the IndexType of the queue.

  2. When you specify MQMO_MATCH_MSG_TOKEN for a queue that has an IndexType of MQIT_MSG_TOKEN, we can specify no other MQMO_* options.

On return from an MQGET call, the MsgToken field is set to the message token of the message returned

This is an input/output field if MQMO_MATCH_MSG_TOKEN is specified, and an output field otherwise. The length of this field is given by MQ_MSG_TOKEN_LENGTH. The initial value of this field is MQMTOK_NONE. This field is ignored if Vis less than MQGMO_VERSION_3.



 

Home