WebSphere Message Brokers
File: ac34680_
Writer: Jane Brockbank

Reference topic

This build: July 31, 2007 21:20:27

A request-response scenario using an MQGet node

This topic describes a scenario in which an MQGet node is used in a request-response flow, and explains how the node processes the input messages to construct the output messages, based on both the content of the LocalEnvironment tree and the input parameters that you set.

A request-response flow is a specialized form of a point-to-point application. More details of these applications are available in application communication models, see the Related links. For an example of a request-response message flow, see the following sample: You can view samples only when you use the information center that is integrated with the Message Brokers Toolkit.

You can include an MQGet node anywhere in a message flow, including a flow that implements a request-response scenario. The node receives an input message on its input terminal from the preceding node in the message flow. It issues an MQGET call to retrieve a message from the WebSphere MQ queue that you have configured in its properties, and builds a result message tree. Finally, it uses the input tree and the result tree to create an output tree that is then propagated to its Output, Warning, or Failure terminal, depending on the configuration of the node and the result of the MQGET operation.

How the MQGet node handles the LocalEnvironment

The MQGet node examines the LocalEnvironment tree that is propagated from the preceding node. It uses the content related to the MQGMO (MQ Get Message Options) and the MQMD (MQ Message Descriptor header), and updates the LocalEnvironment:

  • The node reads the MQGMO structure from ${inputMQParmsLocation}.MQGMO.*.
  • The node copies the WebSphere MQ completion and reason codes to ${outputMQParmsLocation}.CC and ${outputMQParmsLocation}.RC.
  • The node writes the complete MQGMO that is used for the MQGET call into ${outputMQParmsLocation}.MQGMO if ${inputMQParmsLocation}.MQGMO exists in the input tree.
  • The node writes the MQMD that is passed to the MQGET call (that contains the values that are specified in the input message or are generated by the node) into ${inputMQParmsLocation}.MQMD, deleting any existing content.

Set the value to ${inputMQParmsLocation} in the MQGet node property Input MQ Parameters Location on the Request Properties tab.

Set the value to ${outputMQParmsLocation} in the MQGet node property Output MQ Parameters Location on the Result Properties tab.

If you want more information about the properties of the MQGet node see the Related links.

In summary:
${inputMQParmsLocation}
  • QueueName: Optional override for MQGet node Queue Name property
  • InitialBufferSize: Optional override for MQGet node Initial Buffer Size property
  • MQGMO.*: Optional MQGET message options that are used by the MQGet node
${outputMQParmsLocation}
  • CC: MQGET call completion code
  • RC: MQGET call result code
  • MQGMO.*: MQGET message options that are used if present in ${inputMQParmsLocation}
  • MQMD: MQ Message Descriptor for received messages

How the MQMD for the MQGET call is constructed

  • If you do not supply an input MQMD, a default MQMD is used. For further information about MQMD refer to the Application Programming Reference in the WebSphere MQ Version 6 information center online).
  • If you do supply an input MQMD, it is used in one of the following ways:
    • If the property Use complete input MQMD is set, the input MQMD is used in its entirety.
    • If the property Use complete input MQMD is not set, a default MQMD is prepared. If the properties Get by Message ID or Get by Correlation ID are selected, the respective IDs are copied into the default MQMD from the input MQMD.

The following diagram shows how the MQGet node constructs the MQMD that is used on the call to WebSphere MQ:

The diagram is described in the text above.

How the output message tree is constructed

The following diagram outlines how the MQGet node constructs the output message tree, combining the input tree from the previous node with the result tree from the MQGET call:

The diagram is described in the text above.

In this example, the MQGet node properties are configured as listed below:
Table 1.
Property Action
Copy Message Copy Entire Message
Generate Mode Message
Output Data Location OutputRoot.XMLNS.A
Result Data Location ResultRoot.XMLNS.C
The MQGet node constructs the output tree according to the following sequence:
  1. The whole of the input tree is copied to the output tree, including the XML branch with child A, and A's child B.
  2. From the result tree, the XML branch's child C, and C's child D, are put into the output tree at position OutputRoot.XMLNS.A. Any previous content of A (values and children) is lost, and replaced with C's content, including all values and children it has, in this case child D.
  3. The position in the output tree retains the name A.

The following diagram illustrates this:

The diagram is described in the text above.

For some examples of message trees that are constructed by the MQGet node according to the rules described above, see the Related links.

Notices | Trademarks | Downloads | Library | Support | Feedback

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

ac34680_ This topic's URL is: