+

Search Tips | Advanced Search

Verify the sample IT configuration

Run the sample stand-alone JMS application to send and receive messages through IBM MQ, and verify that we have configured IBM MQ correctly for use with the sample application.


Before starting

Download the sample application package. Click the following link and save the file to the computer on which we are installing IBM MQ: sampleJMSApp.zip, then extract the contents. The package contains a sample JMS application .jar file and batch files for running the application.

  • The sample sampleJMSApp.jar file and the .cmd files must be in the same directory.
  • The .cmd files use environment variables to set the class path for running the JMS application. When running the JMS application, if you see a Java java.lang.NoClassDefFoundError, you might need to adjust the class path line in the command file.


About this task

The JMS application comprises a requester client, which sends the initial message, and a responder client, which receives the message and sends a reply. The supplied batch files perform the following actions:

  • runresponder.cmd opens a command prompt window in which the responder client starts then waits for a message.
  • runrequester.cmd opens a separate command prompt window in which the requester client starts then sends a request message and receives a reply.

With two command prompt windows, we can see the actions of the requester and responder separately and more clearly.


Procedure

  1. Double-click the runresponder.cmd file. In the command prompt window, labeled Responder window, the responder client starts then waits for a message.
    > Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to QueueManager.> Created connection.
    > Waiting for message.
    
  2. Double-click the runrequester.cmd file. In the Requester window, observe the requester messages. In the Responder window, observe the updated responder messages; the message it received (from the requester client) and the reply message that it sent.


Results

In the command prompt window, labeled Requester window, the requester client shows the connection status, the message it sent, then the reply message that it received from the responder client:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to QueueManager.> Connection created.
> Sending stock request for 'BakedBeans'> Sent Message ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002b02
> Received Message ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002902 for 'B
akedBeans - 15 tins in stock'
> Closing connection to QueueManager.> Closed Connection.
--------------------------------------------------------
In this window, observe the messages sent through IBM MQ:
- The request message sent
- The reply message received
-----
When ready, press any key to close this window
Press any key to continue . . .
In the Responder window, observe the updated responder messages; the message it received (from the requester client) and the reply message that it sent:
> Connection factory located in JNDI.> Destination located in JNDI.> Creating connection to QueueManager.> Created connection.
> Waiting for message.

> Received Message ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002b02 for 'B
akedBeans'
> Sending Reply Message 'BakedBeans - 15 tins in stock'> Sent Message ID=ID:414d5120514d5f4c33344c3238482020c3cd094d20002902
> Closing connection to QueueManager.> Closed connection.
--------------------------------------------------------
In this window, observe the updated responder messages
- The request message received (from the requester)
- The reply message sent
-----
When ready, press any key to close this window
Press any key to continue . . .

The messages shown in the two command windows verify that the requester and responder clients of the sample application can communicate with each other through IBM MQ.


What to do next

You are now ready to start migrating your sample IBM MQ Version 9.1 installation to a later release of IBM MQ using one of the following two migration options:

Parent topic: Create a sample initial IT configuration Previous topic: Configure the JNDI namespace and administered objects

Last updated: 2020-10-04