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.
- Create the example application in Anypoint Studio. Do not run the application.
- Add your WebSphere MQ client libraries to the project build path.
- Make sure your WebSphere MQ installation has a channel and queues named "in" and "out."
- 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:
- Run the application.
This section demonstrates basic usage of the application: sending text messages, then retrieving them from a WebSphere MQ using Mule.
After Mule starts, open a Web browser and navigate to the following URL:
- 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".
- 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.
- 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