Running the Timeout Processing sample

The Timeout Processing sample has two parts that are run separately:

If you encounter any problems when you run the sample, see Resolving problems when running samples in the WebSphere Message Broker documentation.

Automatic timeout processing

After the AutomaticTimeout message flow is deployed it runs automatically. Messages are displayed ten seconds apart on the TIMEOUT_SAMPLE_OUT_1 queue while the broker is running.

Controlled timeout processing

After the ControlledTimeout message flow is deployed, you must run it with the sample messages:
  1. In the Broker Development view, expand the Timeout Message Flows project.
  2. To open the file in the Test Client, double-click SetTenTimeout.mbtest.
  3. In the Test Client, click Enqueue.
  4. Click Send Message. A request message is sent to the TIMEOUT_SAMPLE_IN_1 queue, and ten copies of the original message, ten seconds apart, are displayed on the TIMEOUT_SAMPLE_OUT_2 queue.

When the test has completed, repeat the procedure with the SetUnlimitedTimeout.mbtest file. This action writes a message containing an unlimited (non-terminating) timeout request to the TIMEOUT_SAMPLE_IN_2 queue, and copies of the original message are displayed on the TIMEOUT_SAMPLE_OUT_2 queue, ten seconds apart. The output messages contain a fragment (the first Invoice record) of the original input message.

The unlimited timeout request runs until it is told to finish. You can stop it with a corresponding cancellation request:

  1. To open the file in the Test Client, double-click CancelUnlimitedTimeout.mbtest. The file contains nothing, except a cancellation request for the unlimited timeout request in the SetUnlimitedTimeout.mbtest file.
  2. Click Send Message. Messages stop being displayed on the TIMEOUT_SAMPLE_OUT_2 queue.

You can also stop the ten-times timeout request in the same manner, by using the CancelTenTimeout.mbtest file.

You can run the limited and unlimited timeouts together, by running both messages in the flow close together. The Controlled node processes them as they each run, and the output messages are mixed on the TIMEOUT_SAMPLE_OUT_2 queue. You cannot run two instances of either timeout request together, the second instance generates an error in the TimeoutControl node because it does not overwrite the existing request. This action is not a limitation of the Timeout nodes generally, it is a limitation of this sample; the timeout requests in the .mbtest files in the sample have hard-coded identifiers.

Verifying success

Success is determined by the arrival of messages on the TIMEOUT_SAMPLE_OUT_1 and TIMEOUT_SAMPLE_OUT_2 queues. The first queue contains the messages from the AutomaticTimeout message flow, which are ten seconds apart and that keep being displayed while the message flow is running. The second queue contains the messages from the ControlledTimeout message flow, which are in groups that are each separated by ten second intervals, depending on the order and timing of the request invocation.

To view the messages on the TIMEOUT_SAMPLE_OUT_1 queue, use the following instructions:

  1. To open the file in the Test Client, double-click TIMEOUT_SAMPLE_OUT_1.mbtest.
  2. Click Get Message to read a message from the TIMEOUT_SAMPLE_OUT_1 queue.

The messages on the queue are automatically generated, and look like the following message:

<TimeoutRequest>
 <Action>SET</Action>
 <Identifier>SampleAuto</Identifier>
 <StartDate>2007-08-31</StartDate>
 <StartTime>13:04:12.295</StartTime>
 <Count>3</Count>
 <Interval>10</Interval>
 <IgnoreMissed>true</IgnoreMissed>
 <AllowOverwrite>true</AllowOverwrite>
</TimeoutRequest>

To view the messages on the TIMEOUT_SAMPLE_OUT_2 queue, use the following instructions:

  1. To open the file in the Test Client, double-click TIMEOUT_SAMPLE_OUT_2.mbtest.
  2. Click Get Message to read a message from the TIMEOUT_SAMPLE_OUT_2 queue.

The messages on the TIMEOUT_SAMPLE_OUT_2 queue contain either the entire input message or a small part of it.

Back to sample home