Running the Coordinated Request Reply sample

You can run the Coordinated Request Reply sample to perform the following processing:

  1. Convert a WebSphere MQ or a JMS message with an XML payload into one containing the same data but in a CWF format
  2. Store the initial ReplyToQ and ReplyToQMgr in a global cache or store in a WebSphere MQ or JMS message for later use
  3. Run a simulated application to read a WebSphere MQ or JMS message with a payload in CWF format, add the current time to the message, and reply by using a WebSphere MQ or a JMS message with a payload in CWF format
  4. Retrieve the original ReplyToQ and ReplyToQMgr from the global cache or from the WebSphere MQ or JMS message that was created in Step 2.
  5. Convert the WebSphere MQ or JMS message with the payload in CWF format into one containing the same data but in an XML format, and send it as a reply to the original request by using the retrieved values for ReplyToQ and ReplyToQMgr.

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

To run the Coordinated Request Reply WebSphere MQ sample:

  1. Ensure that the sample message flows and message set have been deployed.
  2. In the Application Development view, expand the Coordinated Request Reply MQ Application. Under Flow Tests, double-click Requester.mbtest to open it in the Test Client.
  3. In the Test Client, click Enqueue.
  4. Scroll to the bottom of the message data section, in the detailed properties section on the right, and observe that the value for CompletionTime is 12:00:00.
  5. Ensure that the port set in the test client matches the port that your queue manager is using.
  6. Click Send Message to place a WebSphere MQ message on the input queue of the Request message flow.
  7. Leave a sufficient amount of time for the message to be processed by the flow and put to the output queue. If you click Dequeue before the message has been processed, an error message is shown.
  8. In the Test Client, click Dequeue. Modify the queue name to GET_REQREP_OUT.
  9. Ensure that the port set in the test client matches the port that your queue manager is using.
  10. Click Get Message to get a message from the queue.
  11. Scroll to the end of the message and observe that the initial CompletionTime value <st1:time hour="0" minute="0">of 12:00:00</st1:time> has been replaced by the current time, which demonstrates that this message was processed in the Backend Reply message flow.

When you have observed that the value of CompletionTime has changed to a value other than 12:00:00, you have successfully run the Coordinated Request Reply WebSphere MQ sample. If you run the test at exactly 12:00:00, the CompletionTime does not change, run the sample again to ensure that the time in the message is updated in the Backend message flow.

To run the Coordinated Request Reply JMS sample:

  1. Before you start, follow the setup instructions, see Setting up the Coordinated Request Reply JMS Application.
  2. Ensure that the sample message flows and message set have been deployed.
  3. In the Application Development view, under Independent Resources expand Coordinated Request Reply JMS Java Application Project. Under src > jmsnode, double-click JMSP2PSender.java to open it in the Text editor.
  4. Search for variable jmsmsg and observe that the value for CompletionTime is 12:00:00.
  5. Right-click JMSP2PSender.java and select Run As > Java Application to place a JMS message on the input queue of the Request message flow.
  6. In the Application Development view, expand the Coordinated Request Reply JMS Application. Under Flow Tests, double-click Requester.mbtest to open it in the Test Client.
  7. In the Test Client, click Dequeue. Modify the queue name to GET_JMS_REQREP_OUT.
  8. Ensure that the port set in the test client matches the port that your queue manager is using.
  9. Click Get Message to get a message from the queue.
  10. Scroll to the end of the message and observe that the initial CompletionTime value <st1:time hour="0" minute="0">of 12:00:00</st1:time> has been replaced by the current time, which demonstrates that this message was processed in the Backend Reply message flow.

When you have observed that the value of CompletionTime has changed to a value other than 12:00:00, you have successfully run the Coordinated Request Reply JMS sample. If you run the test at exactly 12:00:00, the CompletionTime value does not change, run the sample again to ensure that the time in the message is updated in the Backend message flow.

To run the Coordinated Request Reply Global Cache:

  1. Ensure that the sample message flows and message set have been deployed.
  2. In the Application Development view, expand the Coordinated Request Reply Global Cache Application. Under Flow Tests, double-click Requester.mbtest to open it in the Test Client.
  3. In the Test Client, click Enqueue.
  4. Scroll to the bottom of the message data section, in the detailed properties section on the right, and observe that the value for CompletionTime is 12:00:00.
  5. Ensure that the port set in the test client matches the port that your queue manager is using.
  6. Click Send Message to place a WebSphere MQ message on the input queue of the Request message flow.
  7. In the Test Client, click Dequeue. Modify the queue name to GET_REQREP_GC_OUT.
  8. Ensure that the port set in the test client matches the port that your queue manager is using.
  9. Click Get Message to get a message from the queue.
  10. Scroll to the end of the message and observe that the initial CompletionTime value <st1:time hour="0" minute="0">of 12:00:00</st1:time> has been replaced by the current time, which demonstrates that this message was processed in the Backend Reply message flow.

When you have observed that the value of CompletionTime has changed to a value other than 12:00:00, you have successfully run the Coordinated Request Reply Global Cache sample. If you run the test at exactly 12:00:00, the CompletionTime does not change, run the sample again to ensure that the time in the message is updated in the Backend message flow.

Back to sample home