Setting up the Error Handler sample

When you have imported the Error Handler sample, you must configure the sample to use transactionality before you can deploy the sample to the broker.

Complete the following tasks to set up the Error Handler sample to use transactionality:

  1. Stop the broker.
    1. On Windows: Start a command console in which you can run broker commands.

      On Linux: Run the mqsiprofile command in a terminal window.

    2. Enter the following command on the command line to stop your broker, where MB8BROKER is the name of your broker:

      mqsistop MB8BROKER
  2. Configure the database for transactionality.

    Follow the instructions relevant to your database manager, see Configuring databases for global coordination of transactions in the WebSphere Message Broker documentation.

  3. Configure WebSphere MQ for transactionality.

    Define the STAFFDB database as an XA resource manager to the queue manager for the broker. The queue manager acts as the transaction manager. The broker is MB8BROKER, the queue manager is MB8QMGR, and the data source name is STAFFDB.

    Follow the instructions relevant to your database manager, see Configuring global coordination of transactions in the WebSphere Message Broker documentation.
  4. Restart your broker.
    1. On Windows: Start the command console in which you can run broker commands.

      On Linux: Run the mqsiprofile command in a terminal window.

    2. Enter the following command on the command line to start your broker, where MB8BROKER is the name of your broker:

      mqsistart MB8BROKER
  5. Deploy the sample to the broker.
    1. In the WebSphere Message Broker Toolkit, switch to the Broker Application Development perspective.
    2. Create a new broker archive (BAR) file and add Main_Flow.msgflow to the BAR file:
      1. In the Broker Development view, click File > New > BAR File. The New Message Broker Archive wizard opens.
      2. In the New Message Broker Archive wizard, select the Error Handler Message Flows project and enter a name for the BAR file, click Finish. The new BAR file is created and opens in the Broker Archive editor.
      3. In the Broker Archive editor, select the Message Flows project check box. The Main_Flow.msgflow check box is automatically selected.
      4. Click Build broker archive, click OK. The Main_Flow.msgflow file is added to the BAR file.
    3. Configure the message flow to run as a coordinated transaction:
      1. To switch to the Manage page, click the Manage tab at the bottom of the Broker Archive editor window.
      2. Right-click Main_Flow.cmf.
      3. The configurable properties of Main_Flow.cmf are displayed in the Properties view.
      4. Select the Coordinated Transaction check box.
    4. Press Ctrl+S to save the BAR file.
    5. Ensure that the WebSphere Message Broker Toolkit is connected to the broker MB8BROKER.
    6. Create a new execution group called ErrorHandler:
      1. In the Brokers view, right-click the broker MB8BROKER, click New > Execution Group.
      2. In the New Execution Group window enter ErrorHandler.
      3. Click OK to add the execution group to the broker.
    7. Deploy the BAR file:
      1. In the Broker Development view, right-click the BAR file that you created, click Deploy File.
      2. In the "Deploy a BAR File" window, click the ErrorHandler execution group,
      3. Click OK, the Main_Flow.msgflow file is deployed to the broker.

You can now run the Error Handler sample. See Running the sample.

Back to sample home