IBM Integration Bus, Version 10.0.0.2 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


Receive an MQ datagram message, transform the message, and pass it to an MQ queue

Transform WebSphere® MQ messages in IBM® Integration Bus in a one-way message pattern.

Before you begin

For this scenario, server bindings are used on the MQ nodes to connect to WebSphere MQ. WebSphere MQ therefore must be installed on the same computer as the integration node. Alternatively, you can configure the MQ nodes for remote connections, but these steps are not described within the scenario. For more information, see Configuring connections to WebSphere MQ.

About this task

This scenario is used to create a one-way messaging pattern.

Scenario:

In an existing WebSphere MQ messaging topology, you can use IBM Integration Bus to transform a WebSphere MQ message, and pass it back to a different queue. No reply confirmation is sent; the message is processed and immediately passed to the specified queue. If a reply is required, follow the steps in Receive an MQ request message, pass the message to MQ, and then pass the response from MQ to the requesting client.

For this scenario, there is no message content checking or error handling configured for the message flow nodes, because suitable actions depend on the overall messaging system architecture.

Instructions:

The following steps show how to create a message flow so that a message from WebSphere MQ can be transformed, and then put to another queue.

Procedure

  1. Create a message flow that is named MQ_Task1_One_Way with the following nodes:
    • An MQInput node.
    • A Compute node.
    • An MQOutput node.

    For more information, see Creating a message flow.

  2. Connect the Out terminal of the MQInput node to the In terminal of the Compute node.
  3. Connect the Out terminal of the Compute node to the In terminal of the MQOutput node.
    Image of the message flow and nodes, which are connected as described in the steps.

You must now configure the message flow nodes.

  1. Set the following properties of the MQInput node:
    1. On the Basic tab, set the Queue name property to MQ.TASK1.IN1.
    2. On the MQ Connection tab, set the Connection property to Local queue manager, and then the Destination queue manager property to TASK1_QUEUE_MANAGER.
    3. On the Input Message Parsing tab:
      • Set the Message domain property to XMLNSC.
  2. Set the following properties of the Compute node:
    1. An ESQL module, MQ_Task1_One_Way_Compute, is automatically created. In the Application Development view, open ESQLs, and then the MQ_Task1_One_Way_Compute module.
    2. Copy the following ESQL into the module:
      CREATE COMPUTE MODULE MQ_Task1_One_Way_Compute
      	CREATE FUNCTION Main() RETURNS BOOLEAN
      	BEGIN
      		SET OutputRoot = InputRoot;
      		SET OutputRoot.XMLNSC.Order.TimeStamp = CURRENT_GMTTIMESTAMP;
      		RETURN TRUE;
      	END;
      END MODULE;

      The Compute node represents the solution transformation in this scenario.

      The Compute node adds a time stamp value to the message, which shows the time that it was processed.
  3. Set the following properties of the MQOutput node:
    1. On the Basic tab, set the Queue name property to MQ.TASK1.OUT1.
    2. On the MQ Connection tab, set the Connection property to Local queue manager, and then the Destination queue manager property to TASK1_QUEUE_MANAGER.
  4. Save the message flow.

You can now test the message flow. Create a WebSphere MQ message, send the message to the input queue, and observe the changes to the message on the output queue.

  1. Create a WebSphere MQ message with a Payload that contains XML for the input queue in the following format:
    <SaleEnvelope>
     <OrderNum>123</OrderNum>
     <CustomerNum>456</CustomerNum>
     <ProductCode>789</ProductCode>
     <Qty>20</Qty>
    </SaleEnvelope>
  2. Run the message flow.

Results

When the message flow is run, the following actions occur:
  1. The MQInput reads a WebSphere MQ message in from an application.
  2. The Compute node transforms the message.
  3. The MQOutput node puts the transformed message onto the specified output queue.

bc28621_.htm | Last updated 2015-09-24 12:53:51