Message context

Message context information allows the application that retrieves the message to find out about the originator of the message. The retrieving application may want to:

When you use the MQPUT or MQPUT1 call to put a message on a queue, you can specify that the queue manager is to add some default context information to the message descriptor. Applications that have the appropriate level of authority can add extra context information. For more information on how to specify context information, see Controlling context information.

All context information is stored in the eight context fields of the message descriptor. The type of information falls into two categories: identity and origin context information.

Identity context

Identity context information identifies the user of the application that first put the message on a queue:

Suitably authorized applications may set the above fields.

A Windows systems security identifier (SID) is stored in the AccountingToken field when a message is created under WebSphere MQ for Windows. The SID can be used to supplement the UserIdentifier field and to establish the credentials of a user.

For information on how the queue manager fills the UserIdentifier and AccountingToken fields, see the descriptions of these fields in WebSphere MQ Application Programming Reference.

Applications that pass messages from one queue manager to another should also pass on the identity context information so that other applications know the identity of the originator of the message.

Origin context

Origin context information describes the application that put the message on the queue on which the message is currently stored. The message descriptor contains the following fields for origin context information:

PutApplType The type of application that put the message (for example, a CICS transaction).
PutApplName The name of the application that put the message (for example, the name of a job or transaction).
PutDate The date on which the message was put on the queue.
PutTime The time at which the message was put on the queue.
ApplOriginData Any extra information that an application may want to include about the origin of the message. For example, it could be set by suitably authorized applications to indicate whether the identity data is trusted.

Origin context information is usually supplied by the queue manager. Greenwich Mean Time (GMT) is used for the PutDate and PutTime fields. See the descriptions of these fields in WebSphere MQ Application Programming Reference.

An application with enough authority can provide its own context. This allows accounting information to be preserved when a single user has a different user ID on each of the systems that process a message they have originated.



© IBM Corporation 1993, 2002. All Rights Reserved