Running the Error Handler sample

To run the Error Handler sample you must put each of the messages through the message flows. You can run the sample to learn what happens in the following situations:

For more information, see About the Error Handler sample.

If you have not configured your database and WebSphere MQ as described in the setup instructions (see Setting up the Error Handler sample) you cannot observe the effects of using different units of work in a message flow when you run the sample. However, you can still explore the other aspects of the sample.

When you run the sample, you might see error messages like Unresolvable database table reference T.CLASSTYPE in the Problems view. This warning indicates that definitions for the database tables have not been imported into the project. However, the behavior of the sample at run time is not affected.

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

Running the sample with a message that contains a valid staff number

To run the sample with the message that contains a valid staff number:

  1. In the Broker Development view, double-click staffmsg.mbtest. The staffmsg.mbtest file opens in the Test Client.
  2. In the Test Client, click Enqueue.
  3. Click Send Message. The message that contains the valid staff number is put on the STAFF_IN queue.
  4. View the STAFF table in the STAFFDB database. The table has been updated with the staff information from the input message.
  5. In the Test Client, click Dequeue.
  6. Click Get Message to get the input message from the STAFF_OUT queue. The input message has been written to the output queue.

Running the sample with a message that contains an invalid staff number

To run the sample with the message that contains an invalid staff number:

  1. Open invalidstaffmsg.mbtest in the Test Client, click Enqueue.
  2. Click Send Message.
  3. Look at the results. View the message on the STAFF_UPDATE_ERROR queue.
  4. In the Test Client, click Dequeue.
  5. To get the input message from the STAFF_FAIL queue, click Get Message. The input message has been written to the failure queue.

Running the sample with valid staff number and put-inhibited queues

To run the sample with the message that contains a valid staff number but with the output queues put-inhibited:

  1. Change the STAFF_OUT and STAFF_FAIL queues to put-inhibited:
    1. In WebSphere MQ Explorer, to display the queues for the MB8QMGR queue manager, click the Queues folder for the MB8QMGR queue manager.
    2. Right-click the STAFF_OUT queue, click Properties. The Properties window opens.
    3. In the Properties window, in the Put Messages list, click Inhibited, click OK.
    4. Repeat for the STAFF_FAIL queue.
  2. In the Test Client, open staffmsg.mbtest, click Send Message. The message is put on the STAFF_IN queue. The staff number in the message is valid therefore the message passes through the Update Staff Database node. However, the message cannot be put on the STAFF_OUT or STAFF_FAIL queues, therefore an error is generated and the message is rolled back.
  3. Look at the results:
    1. View the STAFF table in the STAFFDB database. Because the database update was rolled back, the table is unchanged.
    2. View the STAFF_UPDATE_ERRORS queue to see the message which caused the error.

Back to sample home