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
- 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.
- Connect the Out terminal of the MQInput node to the In terminal
of the Compute node.
- Connect the Out terminal of the Compute node to the In terminal
of the MQOutput node.
You must now configure the message flow nodes.
- Set the following properties of the MQInput node:
- On the Basic tab, set the Queue name property to MQ.TASK1.IN1.
- On the MQ Connection tab, set
the Connection property
to Local queue manager,
and then the Destination queue manager property
to TASK1_QUEUE_MANAGER.
- On the Input Message Parsing tab:
- Set the Message domain property
to XMLNSC.
- Set the following properties of the Compute node:
- 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.
- 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.
- Set the following properties of the MQOutput node:
- On the Basic tab, set the Queue name property to MQ.TASK1.OUT1.
- On the MQ Connection tab, set
the Connection property
to Local queue manager,
and then the Destination queue manager property
to TASK1_QUEUE_MANAGER.
- 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.
- 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>
- Run the message flow.
Results
When the message flow is run, the following actions occur:
- The MQInput reads a WebSphere MQ message in from an application.
- The Compute node transforms
the message.
- The MQOutput node puts
the transformed message onto the specified output queue.