Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

WebSphere MQ Example

Enterprise Edition

The WebSphere MQ example demonstrates using Mule’s transport for WebSphere MQ to send and receive transactional messages to WebSphere MQ. This example is available in the enterprise edition of Mule.

Prerequisites

Before you can run the example, ensure the following:

  • Mule enterprise 3.1 or later is installed.

  • WebSphere MQ 6 or 7 is installed.

  • The WebSphere MQ client JARs are available to you.

Installing the example

  1. Copy your WebSphere MQ client JARs to your $MULE_HOME/lib/user directory.

  2. Make sure your WebSphere MQ installation has queues named "in" and
    "out" created.

  3. Copy the example’s zip file into the $MULE_HOME/apps directory.

  4. Start Mule and wait for it to install the example. You may see some exceptions,since the WMQ has not been configured yet. We will do so in the next step.

  5. Now you need to edit the following properties in $MULE_HOME/apps/mule-example-wmq/classes/wmq.properties to reflect your WebSphere MQ installation:

    
               
            
    1
    
    wmq.host=wmq.port=wmq.queue.manager=wmq.username=wmq.password=
  6. Restart Mule.

Running the example

In this part of the example we will demonstrate the basic usage, sending text messages and retrieving them from a WMQ using Mule.

  1. After mule starts up, open the following URL in your browser: http://localhost:8086/services/wmqExample.

  2. You are prompted to enter text to send a message to WebSphere MQ. Your input will be transmitted via AJAX/WMQ to the "in" queue and you will receive confirmation that your message has been submitted. Try entering some text and hit "Send".

  3. The messages sent to the "in" queue will be processed and an intentional 15 second delay will be introduced before sending them back to you via the "out" queue and WMQ/AJAX. You will be notified when the message is received and its content will be added to the table.

  4. Start typing several messages in the text box and hit "Send" to submit them to Mule via AJAX/WMQ. After 15 seconds of intentional delay, the messages will be sent back to you.