MQReply node

This topic contains the following sections:

Purpose

Use the MQReply node to send a response to the originator of the input message. MQReply is a specialized form of the MQOutput node that puts the output message to the WebSphere MQ queue identified by the ReplyToQ field of the input message header. If appropriate, you can define the queue as a WebSphere MQ clustered queue or shared queue.

The MQReply node honors the options set in the Report field in the MQMD. By default (if no options are set), the MQReply node generates a new MsgID and CorrelID in the reply message. If the receiving application expects other values in these fields you must ensure either that the application that puts the message to the message flow input queue sets the required report options, or that you set the appropriate options within the MQMD during message processing in the message flow. For example, use a Compute node to set the Report options in the message.

You can find more information about the Report field in the WebSphere MQ Application Programming Reference.

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

MQReply node icon

Using this node in a message flow

Look at the following sample to see how you can use this node:

You might find it appropriate to use this node when receiving an order from a customer. When the order message is processed, a response is sent to the customer acknowledging receipt of the order and providing a possible date for delivery.

Configuring the MQReply node

When you have put an instance of the MQReply 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.

All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk on the properties dialog.

Configure the MQReply node as follows:

  1. Select the Segmentation Allowed check box if you want WebSphere MQ to break the message into segments in the queue manager, if appropriate. You must also set MQMF_SEGMENTATION_ALLOWED in the MsgFlags field in the MQMD for segmentation to occur.

    More information about the options to which this property maps is available in the WebSphere MQ Application Programming Reference.

  2. Select the Persistence Mode that you want for the output message.
    • If you select Automatic (the default), the persistence is as specified in the incoming message.
    • If you select Yes, the message is put persistently.
    • If you select No, the message is put non-persistently.
    • If you select As Defined for Queue, the message persistence is set as defined in the WebSphere MQ queue.
  3. Select the Transaction Mode that you want for the output message.
    • If you select Automatic (the default), the message transactionality is derived from how it was specified at the MQInput node.
    • If you select Yes, the message is put transactionally.
    • If you select No, the message is put non-transactionally.
  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 Description in the properties dialog navigator to enter a short description, a long description, or both.
  6. Click Apply to make the changes to the MQReply node without closing the properties dialog. 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.

The reply message is put (using MQPUT) to the queue named in the input message MQMD as the ReplyTo queue. You cannot change this destination.

Connecting the output terminals to another node

Connect the out or failure terminal of this node to another node in this message flow if you want to process the message further, process errors, or send the message to an additional destination.

If you connect one of these output terminals to another node in the message flow, the LocalEnvironment associated with the message is enhanced with the following information for each destination to which the message has been put:

  • Queue name
  • Queue manager name
  • Message reply identifier (this is set to the same value as message ID)
  • Message ID (from the MQMD)
  • Correlation ID (from the MQMD)

These values are written in WrittenDestination within the LocalEnvironment tree structure.

If you do not connect one of these out terminals, the LocalEnvironment tree is unchanged.

If you use aggregation in your message flows, you must use these out terminals.

Configuring for coordinated transactions

When you define an MQReply node, the option that you select for the Transaction Mode property defines whether the message is written under syncpoint:

  • If Yes, the message is written under syncpoint (that is, within a WebSphere MQ unit of work).
  • If Automatic (the default), the message is written under syncpoint if the incoming input message is marked persistent.
  • If No, the message is not written under syncpoint.

Another property of the MQReply node, Persistence Mode, defines whether the output message is marked as persistent when it is put to the output queue:

  • If Yes, the message is marked as persistent.
  • If Automatic (the default), the message persistence is determined by the properties of the incoming message, as set in the MQMD (the WebSphere MQ message descriptor).
  • If No, the message is not marked as persistent.
  • If As Defined for Queue, the message persistence is set as defined in the WebSphere MQ queue by the MQReply node specifying the MQPER_PERSISTENCE_AS_Q_DEF option in the MQMD.

Terminals and properties

The MQReply node terminals are described in the following table.

Terminal Description
In The input terminal that accepts a message for processing by the node.
Failure The output terminal to which the message is routed if a failure is detected when the message is put to the output queue.
Out The output terminal to which the message is routed if it has been successfully put to the output queue, and if further processing is required within this message flow.

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 when no default is defined), 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 MQReply node Advanced properties are described in the following table.

Property M C Default Description
Segmentation Allowed Yes No Cleared If appropriate, WebSphere MQ breaks the message into segments in the queue manager. If you select the check box, this action is performed.
Persistence Mode Yes No Automatic Whether the message is put persistently. Valid values are Automatic, Yes, No, and As Defined for Queue.
Transaction Mode Yes No Automatic Whether the message is put transactionally. Valid values are Automatic, Yes, and No.

The Validation properties of the MQReply 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 Yes Yes Inherit Whether validation takes place. Valid values are None, Content and Value, Content, and Inherit.
Failure Action Yes 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 Yes No Selected 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 Yes No None This property cannot be edited.

The MQReply node Description properties are described in the following table.

Property M C Default Description
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.

The MQReply node also has the following properties that you cannot access or modify through the workbench interface. However, these values are used by the broker when the message is processed in the message flow.

Property Description
Queue Manager Name The name of the WebSphere MQ queue manager to which the output queue, identified in Queue Name, is defined. This name is retrieved from the ReplyTo field of the MQMD of the input message.
Queue Name The name of the WebSphere MQ queue to which the output message is put. This name is retrieved from the ReplyTo field of the MQMD of the input message.
Destination This property always has the value reply.