WebSphere Message Brokers
File: ac12610_
Writer: Karen Cameron

Concept topic

This build: July 31, 2007 21:18:31

Message tree structure

The message tree is a part of the logical message tree in which the broker stores its internal representation of the message body.

The root of a message tree is called Root. The message tree is always present, and is passed from node to node within a single instance of a message flow.

The message tree includes all the headers that are present in the message, in addition to the message body. The tree also includes the properties subtree (described in Parsers), if that is created by the parser. If a supplied parser has created the message tree, the element that represents the properties subtree is followed by zero or more headers.

If the message has been received across the WebSphere MQ Enterprise Transport, WebSphere MQ Mobile Transport, or WebSphere MQ Telemetry Transport, the first header (the second element) must be the MQMD. Any additional headers that are included in the message appear in the tree in the same order as in the message. The last element beneath the root of the message tree is always the message body.

If a user-defined parser has created the message tree, the Properties tree, if present, is followed by the message body.

The message tree structure is shown below. If the input message is not a WebSphere MQ message, the headers that are shown might not be present. If the parser that created this tree is a user-defined parser, the Properties tree might not be present.

Message tree structure created by an input node and parser for a message received across a transport that uses WebSphere MQ.

The Body tree is a structure of child elements (described below) that represents the message content (data), and reflects the logical structure of that content. The Body tree is created by the parser (either a supplied parser or a user-defined parser), as described in Parsers.

Each element within the parsed tree is one of three types:

Name element
A name element has a string associated with it, which is the name of the element. An example of a name element is XMLElement, as described in XML element.
Value element
A value element has a value associated with it. An example of a value element is XMLContent, as described in XML content.
Name-value element
A name-value element is an optimization of the case where a name element contains only a value element and nothing else. The element contains both a name and a value. An example of a name-value element is XMLAttribute, as described in XML attribute.

For information about how the message tree is populated, see How the message tree is populated.

Properties folder

The properties folder is the first element of the message tree and holds information about the characteristics of the message.

The root of the properties folder is called Properties. It is the first element under Root. All message trees that are generated by the built-in parsers include a properties folder for the message. If you create your own user-defined parser, you can choose whether the parser creates a properties folder. However, for consistency, you should include this action in the user-defined parser.

The properties folder contains a set of standard properties that you can manipulate in the message flow nodes in the same way as any other property. The majority of these fields map to fields in the supported WebSphere MQ headers, if present, and are passed to the appropriate parser when a message is delivered from one node to another.

For example, the MQRFH2 header contains information about the message set, type, and format. These values are stored in the properties folder as MessageSet, MessageType, and MessageFormat. To access these values using ESQL within the message processing nodes, refer to these values in the properties folder; do not refer directly to the fields in the headers from which they are derived.

If the message is converted to a bit stream, for example in an output node, any properties that remain solely in the properties folder (that is, not in any header in the output messages) are not included in any part of the output message.

The Properties parser ensures that the values in the header fields match the values in the properties folder on input to, and output from, every node. On exit from a node, the Properties parser invokes each header parser with the values that it currently contains. The parser then requests values back from the header parser and updates its own values. If you have coded ESQL in the node that updates values either in the properties folder, or in the header, or both, these values always match when the tree is passed on from that node. However, if you have updated a field in both the properties folder and the header with different values, the value that you set in the header is overwritten by the value that you set in the properties folder.

When the message flow processing is complete, the properties folder is discarded.

Related reference
Built-in nodes
ESQL reference
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:18:31

ac12610_ This topic's URL is: