Building a message object

All WebSphere MQ Everyplace messages are organized and constructed using MQeFields objects. An MQeFields object is a generic container of one or more fields, and each field is a name-value pair. There are also special classes of MQeFields object that contain predefined fields. For example, the WebSphere MQ Everyplace message object is an MQeFields object that MQeQMgrPutMsg() accepts and that MQeQMgrGetMsg() and MQeQMgrBrowseMsgs() return. Each MQeFields object has a type associated with it so that all fields objects in the WebSphere MQ Everyplace system are type identified and can be type checked.

The generic MQeFields object can be used to build and organize data in a hierarchical manner. A set of related name-value fields can be put into an MQeFields object, that is then put into another MQeFields object that is in turn put into a message object for sending.

A filter is an MQeFields object that looks for specific fields in a message. The filter is passed to the MQeQMgrGetMsg() and MQeQMgrBrowseMsgs() API calls to look for messages that contain the same fields.

When a message object is put into the WebSphere MQ Everyplace system, it is tagged with a unique ID that is made up of a unique value field and the origin queue manager name field. In the 'C' API, the message object is tagged every time it is put into the WebSphere MQ Everyplace system with the MQeQMgrPutMsg() call. This tagging guarantees that multiple calls to the MQeQMgrPutMsg() function with the same message object do not introduce duplicate messages into the WebSphere MQ Everyplace network. Since each message object is tagged with a unique ID (UID) every message object retrieved from the WebSphere MQ Everyplace system has a UID tag associated with it.



© IBM Corporation 2002. All Rights Reserved