Message context

Message context information allows the application that retrieves a message to find out about the originator of the message. The information is held in fields in the message descriptor and the fields are divided into two categories: identity context and origin context.

The identity context fields contain information about the user of the application that put the message on the queue. The origin context fields contain information about the application itself and when the message was put on the queue.

When an application puts a message on a queue, the application can ask the queue manager to generate the context information in the message. This is the default action. Alternatively, it can specify that the context fields are to contain no information. The user ID associated with an application requires no special authority to do either of these.

An application can set the identity context fields in a message, allowing the queue manager to generate the origin context, or it can set all the context fields. An application can also pass the identity context fields from a message it has retrieved to a message it is putting on a queue, or it can pass all the context fields. However, the user ID associated with an application requires authority to set or pass context information. An application specifies that it intends to set or pass context information when it opens the queue on which it is about to put messages, and its authority is checked at this time.

Here is a brief description of each of the context fields:

Identity context
UserIdentifier
The user ID associated with the application that put the message. If the queue manager sets this field, it is set to the user ID obtained from the operating system when the application connects to the queue manager.
AccountingToken
Information that can be used to charge for the work done as a result of the message.
ApplIdentityData
If the user ID associated with an application has authority to set the identity context fields, or to set all the context fields, the application can set this field to any value related to identity. If the queue manager sets this field, it is set to blank.
Origin context
PutApplType
The type of the application that put the message; a CICS(R) transaction, for example.
PutApplName
The name of the application that put the message.
PutDate
The date when the message was put.
PutTime
The time when the message was put.
ApplOriginData
If the user ID associated with an application has authority to set all the context fields, the application can set this field to any value related to origin. If the queue manager sets this field, it is set to blank.

For a detailed description of each of the context fields, see the WebSphere MQ Application Programming Reference. For more information about how to use message context, see the WebSphere MQ Application Programming Guide.