Use the MQGet node to receive messages from clients that connect to the broker by using the WebSphere® MQ Enterprise Transport, and the MQI and AMI application programming interfaces.
You can also use the MQGet node to retrieve messages that were previously placed in a WebSphere MQ message queue that is defined to the broker's queue manager.
This topic contains the following sections:
The MQGet node reads a message from a specified queue, and establishes the processing environment for the message. If appropriate, you can define the input queue as a WebSphere MQ clustered queue or shared queue.
You can use an MQGet node anywhere within a message flow, unlike an MQInput node, which you can use only as the first node in a message flow. The output message tree from an MQGet node is constructed by combining the input tree with the result tree from the MQGET call. You can set the properties of the MQGet node to control the way in which messages are received; for example, you can indicate that a message is to be processed under transaction control, or you can request that, when the result tree is being created, data conversion is performed on receipt of every input message.
The MQGet node is contained in the WebSphere MQ drawer of the palette, and is represented in the workbench by the following icon:
When you have put an instance of the MQGet node into a message flow, you can configure it; for more information, see Configuring a message flow node. The properties of the node are displayed in the Properties view. To display the properties of the node in the Properties dialog, either double-click the node, or right-click the node and click Properties.
All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.
Configure the MQGet node.
<mcd><Msd>MRM</Msd><Set>DHM4UO906S001</Set><Type>receiptmsg1</Type> <Fmt>XML</Fmt></mcd>
If you set values, and those values differ from those in the MQRFH2 header, the values in the MQRFH2 header take precedence.
Leave Message set blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.
Leave Message type blank for XML, XMLNS, XMLNSC, JMS, IDOC, MIME, and BLOB parsers.
Leave Message format blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.
If you change this value to Immediate, partial parsing is overridden and everything in the message is parsed and validated, except those complex types with a composition of Choice or Message that cannot be resolved at the time. If you change this value to Complete, partial parsing is overridden and everything in the message is parsed and validated; complex types with a composition of Choice or Message that cannot be resolved at the time cause a validation failure.
You can enter any valid ESQL field reference (this reference can include expressions), including new field references to create a new node within the message tree for inserting the response into the message that is propagated from the input tree. For example, OutputRoot.XMLNS.ABC.DEF and Environment.GotReply are valid field references. For more detailed information, see A request-response scenario using an MQGet node.
When the queue message bit string is parsed to create the contents of the message tree, the message properties that you have specified as the Input Message Parsing properties of the node are used.
You can enter any valid ESQL field reference (see the description of the Output data location property). The data that is placed at this location is always the complete result tree, with the body as a BLOB element. Result data location is not used for warning data.
For more details, see Validating messages and Validation properties.
When you include and configure an MQGet node in a message flow, you might want to override its properties under some conditions. For example, you might want to read from a queue that is identified in another part of the message, or that is retrieved from a database record.
To override the values that you set for the MQGet node properties to achieve a more dynamic way to process messages, include a Compute or JavaCompute node in your message flow before the MQGet node. Configure this node to create a new output message, and add fields to the LocalEnvironment tree to define new values for the properties that you want to change.
For example, add a Compute node into the flow and define a new queue name for the MQGet node to read for messages, by including the following ESQL statement:
SET LocalEnvironment.MQ.GET.QueueName = 'new_queue';
Use LocalEnvironment.MQ.GET. as the correlation name for all fields that relate to the MQGet node.
Connect the Out, Warning, Failure, and No Message output terminals of this node to another node in the message flow to process the message further, process errors, or send the message to an additional destination.
For more information, see Connecting failure terminals.
The terminals of the MQGet node are described in the following table.
Terminal | Description |
---|---|
In | The input terminal that accepts the message that is being processed by the message flow. |
Warning | The output terminal to which the output tree is propagated if an error (with a CC that indicates a warning) occurs within the node while trying to get a message from the queue. The MQMD part of the message is parsed, but the rest of the message is an unparsed BLOB element. The warning is discarded if the terminal is not connected, and there is no output propagation from the node at all. |
Failure | The output terminal to which the input message is routed if an error (with a CC that indicates an error that is more severe than a warning) occurs within the node while trying to get a message from the queue. |
Out | The output terminal to which the message is routed if it is retrieved successfully from the WebSphere MQ queue. |
No Message | The output terminal to which the input message is routed if no message is available on the queue. The output message that is propagated to the No Message terminal is constructed from the input message only, according to the values of the Generate mode, Copy message, and Copy local environment properties. |
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).
The Description properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Node name | No | No | The node type, MQGet | The name of the node. |
Short description | No | No | Blank | A brief description of the node. |
Long description | No | No | Blank | Text that describes the purpose of the node in the message flow. |
The Basic properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Queue name | Yes | Yes | None | The name of the WebSphere MQ message queue from which this node retrieves messages. |
The Input Message Parsing properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Message domain | No | No | None | The domain that is used to parse the queue message. |
Message set | No | No | None | The name or identifier of the message set in which the queue message is defined. |
Message type | No | No | None | The name of the queue message. |
Message format | No | No | None | The name of the physical format of the queue message. |
The Parser Options properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Parse timing | No | No | On Demand | This property controls when the queue message is parsed. Valid values are On Demand, Immediate, and Complete. For a full description of this property, see Parsing on demand. |
Use MQRFH2C compact parser for MQRFH2 domain | No | No | Cleared | This property controls whether the MQRFH2C Compact Parser is used for MQRFH2 headers instead of the MQRFH2 parser. |
Use XMLNSC compact parser for XMLNS domain | No | No | Cleared | This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing properties Message domain is XMLNS. |
Retain mixed content | No | No | Cleared | This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in the queue message message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created. |
Retain comments | No | No | Cleared | This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in the queue message message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created. |
Retain processing instructions | No | No | Cleared | This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in the queue message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created. |
The Advanced properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Transaction mode | No | No | Yes | This property controls whether the incoming message is received under sync point. Valid values are Automatic, Yes, and No. |
Generate mode | No | No | Message | This property controls which parts of the message from the input tree are copied. Valid values are Message, LocalEnvironment, Message And LocalEnvironment, and None. |
Copy message | No | No | None | This property controls which parts of the message from the input tree are copied. Valid values are None, Copy Headers, and Copy Entire Message. |
Copy local environment | No | No | Copy Entire LocalEnvironment | This property controls how the local
environment is copied to the output message. If you set it to Copy Entire LocalEnvironment,
at each node in the message flow a new copy of the local environment
is created in the tree, and it is populated with the contents of the
local environment from the preceding node. Therefore, if a node changes
the local environment, the upstream nodes do not see those changes
because they have their own copies. This behavior might be an issue
if you are using a FlowOrder node,
or if you use the propagate command on a Compute node. If you set this property to None, each node does not generate its own copy of the local environment, but it uses the local environment that is passed to it by the previous node. Therefore, if a node changes the local environment, those changes are seen by the upstream nodes. |
Wait interval (ms) | Yes | No | 1000 | The maximum time, in milliseconds, to wait for the queue message to be obtained from the message queue. |
Minimum message buffer size (KB) | Yes | No | 4 | The minimum size, in KB, of the get buffer. The minimum value of this property is 1. |
The Request properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Input MQMD location | No | No | The location in the input message assembly where the MQMD that is to be used for the MQGET can be found. The default location is InputRoot.MQMD. | |
Input MQ parameters location | No | No | The location in the input message assembly where the WebSphere MQ parameters (for example, the initial buffer size and the MQGMO overrides) can be found. The default location is InputLocalEnvironment.MQ.GET. | |
Get by correlation ID | No | No | Cleared | If you select this check box, only messages that have the specified correlation ID are retrieved. |
Get by message ID | No | No | Cleared | If you select this check box, only messages that have the specified message ID are retrieved. |
Use complete input MQMD | No | No | Cleared | If you select this check box, all MQMD fields supplied are used; otherwise, only the message ID and correlation ID are used. |
The Result properties of the MQGet node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Output data location | No | No | OutputRoot | This property specifies where the output data is placed. If you leave the field blank, OutputRoot is used as a default. |
Result data location | No | No | ResultRoot | This property specifies which subtree (of the queue message) to use. If you leave this field blank, ResultRoot is used as a default, and the whole queue message is used. If, for example, ResultRoot.MQMD.ReplyToQ is specified, only that subtree is used. |
Output MQ parameters location | No | No | This property specifies where the output WebSphere MQ parameters are located. If you leave this field blank, OutputLocalEnvironment.MQ.GET is used as a default. Set Generate mode to include LocalEnvironment to ensure that the updated values are visible in downstream nodes. The default location is OutputLocalEnvironment.MQ.GET. | |
Warning data location | No | No | OutputRoot | This property specifies where the output data is placed if MQGET returns a warning code. If you leave this field blank, OutputRoot is used as a default. |
The Validation properties of the MQGet node are described in the following table.
For a full description of these properties, see Validation properties.Property | M | C | Default | Description |
---|---|---|---|---|
Validate | No | Yes | None | This property controls whether validation takes place. Valid values are None, Content, Content and Value, and Inherit. |
Failure action | No | No | Exception | This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List. |
Include all value constraints | No | No | True | You cannot edit this property. Basic value constraint checks are included in Content and Value validation. |
Fix | No | No | None | You cannot edit this property. |