Posted on

Configuring Websphere MQ

configuring websphere mq message broker

Configure Websphere MQ Messaging Provider

The WebSphere MQ JMS provider maps to the WebSphere MQ messaging system which is one of the most widely used message-oriented-middleware (MOM) product in the industry. It has been available for many years and is widely used to integrate applications on disparate platforms. The key runtime artifact in WebSphere MQ is called a Queue Manager.

Since WebSphere MQ is not part of WebSphere Application Server, its Queue Managers run in separate processes and are separately administered through the WebSphere MQ Queue Manager.

In order to proceed with Websphere MQ configuration, you need to download a trial of it at: http://www-947.ibm.com/support/entry/portal/downloads/software/websphere/websphere_mq\

Create Websphere MQ basic objects

In order to connect to WebSphere MQ messaging provider we will show at first how to create some basic MQ objects. The following commands can be executed from the MQ_HOME/bin folder.

To create a new Queue Manager called MQQueueManager issue the following command:

crtmqm MQQueueManager

Now start the Queue Manager named MQQueueManager by typing the following command:

strmqm MQQueueManager

To stop the Queue Manager enter the following command:

endmqm MQQueueManager

In order to create a new Queue definition for the MQQueueManager, you need to use the runmqsc command which takes its input from stdin, thus you will enter your command interactively.

So, in order to create a Queue definition using MQ scripting, enter the following commands:

runmqsc MQQueueManager  define qlocal(SampleMQ)  end

Now create a listener for your Queue by entering the following commands:

runmqsc MQQueueManager  DEFINE LISTENER(MQQueueManager.listener) TRPTYPE (TCP) PORT(1424)  START LISTENER(MQQueueManager.listener)  end

Finally, restart the QueueManager for your commands to take effect:

endmqm MQQueueManager  strmqm MQQueueManager

Configuring a Connection Factory with WebSphere MQ

To configure a JMS connection factory for the WebSphere MQ provider, choose Resources> JMS> Connection factories. In the Connection factories window, select the Scope of your resource and then click “New”.

configuring websphere mq message broker 

In the next step select the WebSphere MQ messaging provider option,

configuring websphere mq message broker 

Click OK. This will take you to the Step 1 wizard where you need to enter the Name for the Connection Factory and the JNDI name that binds it to the name space.

configuring websphere mq message broker 

Click Next to continue. In the Step 2, you should determine how to connect to Websphere MQ. Choose “Enter all the required information into this wizard “option, as shown:

configuring websphere mq message broker 

Click Next to continue. In the Step 2.1 you need to supply the Queue Manager or Queue sharing group name you wish to connect to. (see the paragraph “Create Websphere MQ basic objects” )

configuring websphere mq message broker 

Click Next. In the Step 2.2 choose the transport type and specify the host and port of the MQ Queue Manager. The port must match the listener port that you defined for the Queue Manager.

configuring websphere mq message broker 

Click Next. You can check your connection by clicking on the Test connection to verify that you can connect to the WebSphere MQ Queue Manager. In the Summary window, review your configuration, then click Finish and Save.