Running the JMS Nodes sample

A IBM Integration Toolkit Test client is provided to input the WebSphere MQ message to the JMS Gateway flow and a Java JMS subscriber application is provided to receive the publication from the JMS Input Publication flow, after all of the configuration steps have been completed.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the IBM Integration Bus documentation.

Input test messages

The test message that is used in running this sample are based on the following format:

<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>

Running the sample

The JMS Node Sample project contains the following files:

To run the sample:

  1. In the IBM Integration Toolkit Application Development view, expand JMSNodeSampleJavaProject, then expand src and jmsnode.
  2. Right-click JMSSubscriber.java, click Run As > Java Application. The JMSSubscriber file runs. Note the JMSSubscriber connects only after the message flow is deployed and started. The JMSSubscriber application receives one message, displays it, and then stops, so if you send more than one message you must run the application again. Note that this application has the name and listener port value of the WebSphere MQ queue manager created by the default configuration wizard defined as constants.
  3. Use Enqueue to put the message.mbtest file to the INPUTQUEUE queue.
    1. In the Application Development view, expand the project called JMSNodesSampleFlowProject, double-click message.mbtest to open it in the Test Client.
    2. Click Send Message.
    The message is put to the INPUTQUEUE queue.

When the message is put from the test client to the INPUTQUEUE WebSphere MQ queue, the message passes through the message JMS Gateway flow, and onto the JMS Input Publication flow via the JMS provider and is received by the JMS subscriber. The output message received by the JMS subscriber is displayed in the console view in the IBM Integration Toolkit, where it can be examined to confirm the processing date and time has been inserted into the timestamp field.

Output test messages

The output message representing an invoice has the following format:

<Parent>
<First>1</First>
<SaleList>
<Invoice>
<Timestamp>2005-01-01 10:10:59</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