Creating WMQ listener

The WMQ non-controlled listener can be configured to listen on a remote WebSphere MQ queue (command queue) where it will accept requests. Every correctly formatted listener command will result in a response being sent to a WebSphere MQ queue defined as its reply queue.

The command request is placed on a specified WebSphere MQ queue. The command will indicate the action to perform (such as write a value to a variable). Upon completion, a response is delivered to a configured reply queue.

Assumptions

Before you begin to create the listener, it is assumed that:

  • IBM WebSphere MQ, Version 5.1 or later was installed and configured as appropriate for your operating environment and local area network.
  • The WebSphere MQ administrator created the queue manager and associated queues and has given you their names.
  • The WebSphere MQ administrator created a communication channel and has given you the name of the channel.

Procedures

To create a WMQ listener, follow these steps:

  1. From the Workbench left pane, expand the node that you want to add the listener to.
  2. Expand Enterprise, right-click the Listeners icon to display its pop-up menu, and then click New.

    The Listener window appears.
  3. The Name box lets you type a unique name for the listener. The name can be up to 64 characters in length and can include letters, numbers, and the underscore character. Spaces are not allowed.
  4. From the Listener Type drop-down list, select WMQ

Parameters tab

The Parameters tab changes to accommodate parameters whose values identify the name of the listener, the channel name, and other connection settings. It is expected that you will have information from the WebSphere MQ administrator in order to correctly fill in the parameter values.

The following describes the parameter values to create a WMQ listener.

Parameter Description
Host This is the host name or IP address of the computer where WebSphere MQ is installed.
Port This is the TCP/IP port identifier that the WebSphere MQ listener will use to listen on.
User This is the user ID to access the queue manager. The WebSphere MQ administrator has this information.
Password This is the password to access the queue manager. The WebSphere MQ administrator has this information.
Manager This is the name of the queue manager. The WebSphere MQ administrator created this queue manager and named it. This is the queue manager that node will connect to. An example format of the queue manager name is ACME.QUEUE.MANAGER. The name must be uppercase letters.
Command Queue This is the command queue. The node will read requests from this queue.
Channel This is the name of the channel. The WebSphere MQ administrator defined this channel and named it.
Correlation ID Optional. This correlation ID value lets you get a particular message from a queue. The listener will only accept messages that contain the correlation ID value. See ** Correlation ID note.
Controlled Listener Select this check box to enable the listener to be controlled by the Get Message From Controlled Listener action.

The Get Message From Controlled Listener action determines when the listener should get the next request from the remote queue. Controlled Listener check box works in conjunction with the Delay (seconds) parameter (next). For more information, see Creating a controlled listener, and the Get Message From Controlled Listener action.
Delay (Seconds) Works in conjunction with Controlled Listener parameter (previous).
Once the listener receives the request from the Get Message From Controlled Listener action, it checks the remote queue for the next request. If no request is available, the listener waits the seconds specified in Delay (seconds). If the request fails, a value is returned to the Get Message From Controlled Listener action indicating a timeout. For more information, click Creating a controlled listener.
Reply Select the check box to indicate a reply queue

The node will place all responses on this queue. However, if the enterprise application specifies a different reply queue, that reply queue will override the reply queue specified here.
Queue The name of the queue where you want the reply sent to.
Extended Attributes Use this button to display the MQMD Header Fields tab that allows you to override some of the default WebSphere MQ extended attributes on the reply message. Typically, these attributes are set to what was received on the MQ request.

Correlation ID note

When multiple listeners are configured on the same or multiple nodes, and the listeners are connecting to the same command queue, the listener should be configured with a unique correlation ID. This will ensure that each listener will not inadvertently get a message meant for another listener that is sharing the same command queue.

The enterprise application will need to put the WebSphere MQ request on the command queue with a correlation ID that matches the correlation ID that the listener is configured with.
 
When you click the Reply Extended Attributes button, the MQMD Header Fields tab becomes available. This tab lets you override some of the default WebSphere MQ extended attributes on the reply message.

Testing and saving the WMQ listener

The Listener window also has Save, Validate, and Cancel buttons.

  • To test a connection, click Validate.

In order to test a WMQ listener, the node must be able to connect to the remote WebSphere MQ command queue and reply queue that were created specifically for the listener.

  • If no errors are received, click Save. The new listener is saved to the node and added to the Listeners tab.
    Validating a listener indicates whether or not the listener has errors. You can save a listener that contains errors. Later, you can edit the listener to correct the errors.
Related topics

Listener Payload tab

Listener Mapping Log tab

What's Inside