Setting the value of message header fields

Each MQ message includes a message header that contains message header fields. You can let WebSphere® MQ set the values for these fields, or you can configure the WebSphere MQ connector to set the value for each message or for all messages.

About this task

By default, IBM® WebSphere MQ sets the values for the message header fields.

To set the message header field values for each message separately, you define one or more WSMQ data element columns on the input link. Each column corresponds to the message header field for which the value needs to be set. For example, to set Priority and MsgId message header field values for each message, you define columns with the WSMQ.PRIORITY and WSMQ.MSGID data element values. Then the value of these fields in each input record specifies the MsgId and Priority message header field values to set for the corresponding message.

To set the message header field values once for all messages, you enter the values in the corresponding properties that appear under the Set header fields property on the Properties page. For example, to use the value 4 for the Priority message header field for all messages, enter 4 as the value in the Priority property.

When a message header field value is specified both through the connector property and in input data through the data element column on the input link, the value in the input data is used.

Procedure

  1. To set values for the identity context of the message, which contains the UserIdentifier, AccountingToken, and ApplIdentityData message header fields, perform these steps:
    1. For the Context mode property, choose Set identity.
    2. Use the stemqaut command to grant the setid authorization for the queue manager that hosts the target queue. For example, the following command grants the setid authorizations for the queue manager QMNAME to the user ID test:
      setmqaut -m QMNAME -t qmgr -p test +setid
    3. Use the setmqaut command to grant the setid authorization for the queue. For example, the following command grants the setid authorization for the queue QUEUE1 under the queue manager QMNAME to the user ID test:
      setmqaut -m QMNAME -t queue -n QUEUE1 -p test +setid
  2. To set values for the origin context of the message, which contains the PutApplType, PutApplName, PutData, PutTime, and ApplOriginData message header fields, perform these steps:
    1. For the Context mode property, choose Set all.
    2. Use the setmqaut command to grant the setall authorization for the queue manager that hosts the target queue. For example, the following command grants the setall authorization for the queue manager QMNAME to the user ID test:
      setmqaut -m QMNAME -t qmgr -p test +setall
    3. Use the setmqaut command to grant the setall authorization for the queue. For example, the following command grants the setall authorization for the queue QUEUE1 under the queue manager QMNAME to the user ID test:
      setmqaut -m QMNAME -t queue -n QUEUE1 -p test +setall