Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

WebSphere MQ

WebSphere MQ

(1 review)

Demonstrates how to use the WebSphere MQ Transport to send and receive transactional messages to WebSphere MQ. This example is available in Mule Enterprise Edition.

At times, you may find the need to bridge a communication gap between IBM's message queue product, Websphere MQ, and Mule. To facilitate message processing across products, Mule uses a WMQ Endpoint.

Set Up and Run the Example

As with other example templates you can create template applications straight out of the box in Anypoint Studio or Mule standalone (Mule Runtime without Studio). You can tweak the configurations of these use case-based templates to create your own customized applications in Mule.


Before you run the example, ensure that your system meets the following conditions:

  • Mule Enterprise is installed
  • WebSphere MQ 6 or 7 is installed
  • WebSphere MQ client JARs are available to you

Follow the procedure below to create, configure, and run the WebSphere MQ application in Anypoint Studio or Mule standalone.

  1. Create the example application in Anypoint Studio. Do not run the application.
  2. Add your WebSphere MQ client libraries to the project build path.
  3. Make sure your WebSphere MQ installation has a channel and queues named "in" and "out."
  4. Edit the following attributes of the global Websphere MQ configuration that are appropriate for your WebSphere MQ installation by opening websphere-mq.xml under src/main/app, then opening Global elements and choosing a WMQ component:
    • ${}
    • ${wmq.port}
    • ${wmq.username}
    • ${wmq.password}
    • ${}
    • ${wmq.queue}
  5. Run the application.

This section demonstrates basic usage of the application: sending text messages, then retrieving them from a WebSphere MQ using Mule.

  1. After Mule starts, open a Web browser and navigate to the following URL:


  2. The application prompts you to enter text to send a message to WebSphere MQ. The app transmits your input via AJAX/WMQ to the Mule application's "in" queue and you receive confirmation that your message has been submitted. Enter some text, then hit "Send".
  3. Mule processes the message sent to the "in" queue, then it sends the confirmation to you via the "out" queue and WMQ/AJAX. Note that Mule introduces an intentional 15 second delay between receiving your message and sending you a confirmation . Mule notifies you when the message is received and its content is added to the table below.
  4. Play with it! Start typing several messages in the text box, then hit "Send" to submit them to Mule via AJAX/WMQ. After 15 seconds of intentional delay, the Mule confirms receipt of the messages.


Read full documentation in GitHub


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onJun 22, 2017


VersionRuntime version