MQGet node

This topic contains the following sections:

Purpose

Use the MQGet node to receive messages from clients that connect to the broker using the WebSphere MQ Enterprise Transport, and that use the MQI and AMI application programming interfaces. The MQGet node can also be used to retrieve messages that were previously placed in a WebSphere MQ message queue that is defined to the broker's queue manager.

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.

An MQGet node can be used anywhere within a message flow, unlike an MQInput node which can only be used 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 that 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 handles messages in the following message domains:

  • MRM
  • XML
  • XMLNS
  • XMLNSC
  • JMSMap
  • JMSStream
  • MIME
  • BLOB
  • IDOC

The MQGet node is represented in the workbench by the following icon:

MQGet node icon

Using the MQGet node in a message flow

Look at the following descriptions and samples to see how you can use the MQGet node in a message flow:

Configuring the MQGet node

When you have put an instance of the MQGet node into a message flow, you can configure it.

Right-click the node in the editor view and click Properties. The node's Basic properties are displayed in the properties dialog.

All mandatory properties are marked with an asterisk on the properties dialog.

Configure the MQGet node by doing the following:

  1. Enter in Queue Name the name of the queue from which the message is to be obtained. You must predefine this WebSphere MQ queue to the queue manager that hosts the broker on which the message flow is deployed. If this queue is not a valid queue, the node generates an exception, and a message is propagated to the failure terminal.
  2. Select Default in the properties dialog navigator and set values for the properties that describe the message domain, message set, message type, and message format that the node uses to determine how to parse the incoming message, and the default topic associated with the message.
    • If the incoming message has an MQRFH2 header, you do not have to set values for the Default properties because the values can be derived from the <mcd> folder in the MQRFH2 header. For example:
      <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.

    • In Message Domain, select the name of the parser that you are using from the drop-down list. You can choose from the following names:
      • MRM
      • XML
      • XMLNS
      • XMLNSC
      • JMSMap
      • JMSStream
      • MIME
      • BLOB
      • IDOC
    • If you are using the MRM or IDOC parser, select the correct message set from the drop-down list in Message Set.

      Leave Message Set blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.

    • If you are using the MRM parser, select the correct message from the drop-down list in Message Type. This list is populated with messages that are defined in the message set that you have selected.

      Leave Message Type blank for XML, XMLNS, XMLNSC, JMS, IDOC, MIME, and BLOB parsers.

    • If you are using the MRM or IDOC parser, select the format of the message from the drop-down list in Message Format. This list includes all the physical formats that you have defined for this message set.

      Leave Message Format blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.

  3. Select Advanced in the properties dialog navigator and set values for the Advanced properties:
    • Select a value for Transaction Mode from the drop-down list to define the transactional characteristics of how this message is handled:
      • If you select Automatic, the message is received under syncpoint if it is marked persistent. If the message is not marked as persistent, it is not received under syncpoint. The persistence or non-persistence of the input message determines the transactionality of any derived messages that are subsequently propagated by an output node, unless the output node, or any other subsequent node in the message flow, explicitly overrides the transactionality.
      • If you select Yes, the incoming message is received under syncpoint. Any derived messages that are subsequently propagated by an output node in the same instance of the message flow are sent transactionally, unless the output node, or any other subsequent node in the message flow, has explicitly overridden the transactionality.
      • If you select No, the incoming message is not received under syncpoint. Any derived messages that are subsequently propagated by an output node in the same instance of the message flow are sent non-transactionally, unless the output node, or any other subsequent node in the message flow, has specified that the messages must be put under syncpoint.
    • Select a value for Generate Mode from the drop-down list to define which components of the output message are generated within the MQGet node, and which components are taken from the input message.
      • If you select None, all components of the message from the input tree are propagated unchanged.
      • If you select Message, a new Message component is created by the node, but the LocalEnvironment, Environment, and ExceptionList components from the input tree are propagated unchanged. This is the default value for Generate Mode.
      • If you select LocalEnvironment, a new LocalEnvironment component is created by the node, but the Message, Environment, and ExceptionList components from the input tree are propagated unchanged.
      • If you select Message and LocalEnvironment, new Message and LocalEnvironment components are created by the node, but the Environment, and ExceptionList components from the input tree are propagated unchanged.
    • If you have chosen Generate Mode to be either Message or Message and LocalEnvironment, select a value for Copy Message from the drop-down list to define which parts of the message are generated within the MQGet node, and which parts are taken from the input message.
      • If you select None, no part of the input message from the input tree is propagated. This is the default value for Copy Message.
      • If you select Copy Headers, the headers from the input message in the input tree are copied in.
      • If you select Copy Entire Message, the entire input message from the input tree is copied in.
    • If you have chosen Generate Mode to be either LocalEnvironment or Message and LocalEnvironment, select a value for Copy Local Environment from the drop-down list to define which parts of the local environment are generated within the MQGet node, and which parts are taken from the input message.
      • If you select None, no part of the local environment is copied in.
      • If you select Copy Entire LocalEnvironment, the entire local environment defined in the input message is copied in. This is the default value for the Copy Local Environment property.
    • Provide a value for the Wait interval property to specify how many milliseconds to wait for a message to be received from the MQGET call. If you do not provide a value, the default value of 1000 milliseconds is used.
    • Provide a value for the Minimum message buffer size property to specify in kilobytes how large the initial buffer for the MQGET call should be. The buffer expands automatically to accept a message of any size, but if it is expected that messages will all be large, by specifying a suitable value you reduce the frequency of the buffer being re-sized. If you do not provide a value, the size of the buffer will initially be 4 kilobytes.
  4. Select Validation in the properties dialog navigator if you want the MRM parser to validate the body of messages against the dictionary generated from the message set. (If a message is propagated to the failure terminal of the node, it is not validated.)

    For more details refer to Validating messages and Validation properties for messages in the MRM domain.

  5. Select Request in the properties dialog navigator and set values for the properties that determine how the request parameters are constructed.
    • If the MQMD that is to be used for the MQGET call is not the default location InputRoot.MQMD, specify in Input MQMD Location the location of the MQMD.
    • If the location of the parameters for the MQGET call (for example, MQGMO overrides), is not the default location InputLocalEnvironment.MQ.GET, specify the location in Input MQ Parameters Location.
    • If you select the Get by Correlation ID check box, the CorrelId field of the message to be retrieved must match the CorrelId field in the the Input MQMD Location. By default, this check box is cleared.
    • If you select the Get by Message ID check box, the MsgId field of the message to be retrieved must match the MsgId field in the the Input MQMD Location. By default, this check box is cleared.
    • If you select the Use complete input MQMD check box, the entire MQMD of the message to be retrieved must match the value of the Input MQMD Location on a bit-for-bit basis. By default, this check box is cleared.
  6. Select Result in the properties dialog navigator and set values for the properties that determine how the results of the MQGET call are handled.
    • In Output Data Location, enter the start location within the output message tree at which the parsed elements from the retrieved message bit string are stored; the default is OutputRoot. All elements at this location are deleted, and the default is to replace the input tree message with the retrieved message.

      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. See Using an MQGet node in a request-response flow for more detailed information.

      When the retrieved message bit string is parsed to create the contents of the message tree, the message properties that you have specified as the Default properties of the node are used.

    • Set a value in Result Data Location to control which subtree of the retrieved message is placed in the output message. The default is ResultRoot which means that the whole retrieved message is placed in the output message. If, for example, you want only the MQMD from the retrieved message, use ResultRoot.MQMD; this subtree is then placed at the location specified by Output Data Location.
    • Set a value in Output MQ Parameters Location to control where the CC (completion code), the RC (return code) and any other MQ parameters (for example the MQMD used by the MQGET call) are placed in the output tree. The default is OutputLocalEnvironment.MQ.GET.
    • Set a value in Warning Data Location to control where the retrieved message is placed when the MQGET call returns a Warning code. The default is OutputRoot.

      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.

  7. Select General Message Options in the properties dialog navigator. Parse Timing is, by default, set to On Demand. This causes validation to be delayed until it is parsed by partial parsing.

    If you change this 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 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.

    For more details refer to Validation properties for messages in the MRM domain.

    Select the check box Use MQRFH2C Compact Parser if you want the MQRFH2C parser to be used. By default, this check box is cleared which means that the compact parser is not used.

  8. Select XMLNSC Parser Options in the properties dialog navigator and set values for the properties that determine how the request parameters are constructed.

    For more information, refer to Manipulating messages using the XMLNSC parser.

  9. Select Description in the properties dialog navigator to enter a short description, a long description, or both.
  10. Click Apply to make the changes to the MQGet node without closing the properties dialog, or click OK to apply the changes and close the properties dialog.

    Click Cancel to close the dialog and discard all the changes that you have made to the properties.

Connecting the terminals

Connect the Out, Warning, Failure, and No Message output terminals of this node to another node in the message flow if you want to process the message further, process errors, or send the message to an additional destination.

What is propagated to each of the output terminals depends on the condition code (CC) generated by the MQGET call.

If the MQGET call is successful, the MQGet node routes each parsed output message to the Out terminal.

If the MQGET call fails, but with a CC indicating a warning, an unparsed output message is propagated to the Warning terminal.

If the MQGET call fails, with a CC more severe than a warning, the input message is propagated to the Failure terminal.

Start of changeIf the MQGET call fails, with a reason code of MQRC_NO_MSG_AVAILABLE, the output message is propagated (without a result body) to the No Message terminal. 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 and Copy Message, or Copy Local Environment properties.End of change

If you do not connect the Out, Warning, or No Message terminals to another node in the message flow, anything that is propagated to those terminals is discarded.

If you do not connect the Failure terminal to another node in the message flow, an exception is thrown by the broker when anything is propagated to that terminal.

See Connecting failure terminals for more information,

Configuring for coordinated transactions

When you include an MQGet node in a message flow, the value that you set for Transaction Mode defines whether messages are received under syncpoint:

  • If you set it to Yes (the default), the message is received under syncpoint (that is, within a WebSphere MQ unit of work). Any messages subsequently sent by an output node in the same instance of the message flow are put under syncpoint, unless the output node, or any other subsequent node, has explicitly overridden this.
  • If you set it to Automatic, the message is received under syncpoint if the incoming message is marked persistent. Otherwise, it is not. Any message subsequently sent by an output node is put under syncpoint, as determined by the incoming persistence property, unless the output node, or any other subsequent node, has explicitly overridden this.
  • If you set it to No, the message is not received under syncpoint. Any messages subsequently sent by an output node in the flow are not put under syncpoint, unless an individual output node, or any other subsequent node, has specified that the message must be put under syncpoint.

Terminals and properties

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 successfully retrieved from the WebSphere MQ queue.
No Message Start of changeThe output terminal to which the input message is routed if no message was 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 and Copy Message, or Copy Local Environment properties.End of change

The following tables describe the node properties; the column headed M indicates whether the property is mandatory (marked with an asterisk on the properties dialog 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 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 Default properties of the MQGet node are described in the following table.

Property M C Default Description
Message Domain No No None The domain that will be used to parse the message that is obtained from the message queue.
Message Set No No  None The name or identifier of the message set in which the message that is obtained from the message queue is defined.
Message Type No No  None The name of the message that is obtained from the message queue.
Message Format No No  None The name of the physical format of the message that is obtained from the message queue.

The Advanced properties of the MQGet node are described in the following table.

Property M C Default Description
Transaction Mode No No Yes Whether the incoming message is received under syncpoint. Valid values are Automatic, Yes, and No.
Generate Mode No No Message 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 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   Which parts of the message from the input tree are copied. Valid values are None, and Copy Entire LocalEnvironment. The default value is Copy Entire LocalEnvironment.
Wait interval Yes No 1000 The maximum time, in milliseconds, to wait for the message to be obtained from the message queue.
Minimum message buffer size Yes No  4 The minimum size, in kilobytes, of the get buffer. The minimum value of this property is 1 kilobyte.

The Validation properties of the MQGet node are described in the following table.

Refer to Validation properties for messages in the MRM domain for a full description of these properties.
Property M C Default Description
Validate No Yes None Whether validation takes place. Valid values are None, Content, Content and Value, and Inherit.
Failure Action No No Exception 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 This property cannot be edited. The default action, indicated by the check box being selected, is that basic value constraint checks are included in Content and Value validation.
Fix No No None This property cannot be edited.

The Request properties of the MQGet node are described in the following table.

Property M C Default Description
Input MQMD Location No No   Specifies where in the input message assembly 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   Specifies where in the input message assembly the 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 False When selected, this check box causes only messages that have the specified correlation ID to be got.
Get by Message ID No No False When selected, this check box causes only messages that have the specified message ID to be got.
Use complete input MQMD No No False When selected, this check box causes the complete MQMD to be used. Otherwise, only the message ID and correlation ID will be 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 Specifies where the output data is placed. If left blank, OutputRoot is used as a default.
Result Data Location No No ResultRoot Specifies which subtree (of the retrieved message) to use. If left blank, ResultRoot is used as a default, and the whole retrieved message is used. If, for example, ResultRoot.MQMD.ReplyToQ is specified, only that subtree is used.
Output MQ Parameters Location No No   Specifies where the output MQ parameters are located. If left blank, OutputLocalEnvironment.MQ.GET is used as a default. Generate Mode should be set 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 Specifies where the output data is placed if MQGET returns a warning code. If left blank, OutputRoot is used as a default.

The properties of the General Message Options for the MQGet node are described in the following table.

Property M C Default Description
Parse Timing No No On Demand This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete.

Refer to Parsing on demand for a full description of this property.

Use MQRFH2C Compact Parser for MQRFH2 Domain No No False This property controls whether the MQRFH2C Compact Parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.

The properties of the XMLNSC Parser Options for the MQGet node are described in the following table.

Property M C Default Description
Use XMLNSC Compact Parser for XMLNS Domain No No False Start of changeThis property gives you control over whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. Note that if you set this property, the message data will appear under XMLNSC in nodes that are connected to the output terminal when the input RFH2 header or Default properties Domain is XMLNS.End of change
Mixed Content Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. Valid values are None and All. Selecting All means that elements are created for mixed text. Selecting None means that mixed text is ignored and no elements are created.
Comments Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. Valid values are None and All. Selecting All means that elements are created for comments. Selecting None means that comments are ignored and no elements are created.
Processing Instructions Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. Valid values are None and All. Selecting All means that elements are created for processing instructions. Selecting None means that processing instructions are ignored and no elements are created.

The Description properties of the MQGet node are described in the following table.

Property M C Default Description
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.