The JMS Nodes sample is a message flow sample application that shows how to use JMSInput and JMSOutput nodes as a JMS consumer and producer respectively to an external JMS provider. The sample uses WebSphere MQ as the JMS provider.
There are two message flows in the sample, one representing an external JMS provider and one showing an example of how to use the JMS nodes in a broker. The Compute nodes in each message flow contain detailed ESQL comments explaining exactly what has been done to achieve the required behaviour.
This flow represents a JMS provider.
This flow uses an XML message. When the message is passed through the flow, the message is modified in the Compute 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 producer message, and is put on a queue for the JMSInput_Publication flow to pick up.
In this flow, the JMSInput node is a message consumer to an external JMS Provider, which is WebSphere MQ in this sample. The message received is then transformed into a publication and put in the publication engine.
The JMSInput node gets the XML message from the queue, and passes it to
the Compute node. The Compute node creates a new publication message on the update/stock topic, and issues the whole message as a new invoice.
The test message used to drive the sample is a straightforward XML message that contains invoice details for a customer:
<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>