About the JMS Node sample

The JMS Nodes sample is a message flow sample application that shows how you can use a JMSInput node as a JMS consumer and a JMSOutput node as a JMS producer, from and to an external JMS provider. The sample uses WebSphere MQ as the JMS provider.

Message Flows

Two message flows are shown in the sample, one providing a transport gateway to an external JMS provider and one showing an example of how you can use a message flow as a JMS consumer. The message flows also show the use of the nodes provided for transforming from JMS to WebSphere MQ messages. The Mapping nodes in each message flow show exactly what has been done to achieve the required behavior.

JMSGateway message flow

This flow represents providing a transport gateway from WebSphere MQ to an external JMS provider. The Integration toolkit test client is used to send the WebSphere MQ message to the flow.

A screen capture of the JMSGateway message flow

This flow uses an XML message. When the message is passed through the flow, the message is modified in the Mapping node by adding the current date in the <Timestamp> element:

<Parent>
<First>1</First>
<SaleList>
<Invoice>
<Timestamp>2005-01-01 10:10:59</Timestamp>
.
.
.
</Invoice>
</SaleList>
<Last>Test</Last>
</Parent>

The message is then turned into a JMS producer message, and is put on a JMS destination for the following JMSInput_Publication flow to pick up.

JMSInput_Publication message flow

In this flow, the JMSInput node is a JMS consumer to an external JMS provider. The message received is then transformed into a publication and emitted by a publication node.

A screen capture of the JMSInput_Publication message flow

The JMSInput node gets the XML message from the JMS destination, and passes it to the Mapping node. The Mapping node creates a new publication message on the update/stock topic, and issues the whole message as a new invoice. A JMS subscriber Java application is then provided to receive and display the publication message.

Test message

The test message that is used to drive the sample is an XML message that contains invoice details for a customer. As noted above the timestamp field which is initially empty will be updated in the message flow to the current time:

<Parent>
<First>1</First>
<SaleList>
<Invoice>
<Timestamp></Timestamp>
<Initial>T</Initial>
<Initial>D</Initial>
<Surname>Montana</Surname>
<Item><Code>00</Code>
<Code>01</Code><Code>02</Code>
<Description>Twister</Description>
<Category>Games</Category>
<Price>00.30</Price>
<Quantity>01</Quantity>
</Item>
<Item>
<Code>02</Code><Code>03</Code><Code>01</Code>
<Description>The Times Newspaper</Description>
<Category>Books and Media</Category>
<Price>00.20</Price>
<Quantity>01</Quantity>
</Item>
<Balance>00.50</Balance>
<Currency>Sterling</Currency>
</Invoice>
</SaleList>
<Last>Test</Last>
</Parent>

Back to sample home