IBM MQ link sample configuration
This sample configuration illustrates how you can use a IBM MQ link to connect WebSphere® Application Server service integration messaging to IBM MQ messaging.
A IBM MQ link connects one service integration messaging engine, called the gateway messaging engine, to one IBM MQ queue manager or queue-sharing group, called the gateway queue manager. All messaging engines in the service integration bus use the gateway messaging engine to route messages to and from the IBM MQ network; all queue managers and queue-sharing groups in the IBM MQ network use the gateway queue manager to route messages to and from the service integration bus.
- The IBM MQ link sender channel, which carries messages from service integration to IBM MQ.
- The IBM MQ link receiver channel, which carries messages from WebSphere MQ to service integration.

If you only require messages to flow in one direction, you need only define one TCP/IP connection. For example, a IBM MQ link sender channel in service integration that connects to a receiver channel in IBM MQ is enough to support message flow from service integration to IBM MQ. However, this sample builds a configuration that allows messages to flow in both directions.
Sample configuration context
- An application server called server1 located on a node called London. In a Network Deployment, server1 might be one of several servers in a cell and might be one of several servers in a cluster, but this sample is equally applicable to a base deployment containing just one application server.
- The IP host name for the server London is LONDON.
- A service integration bus called BUS1.
- server1 is a member of BUS1; the messaging engine it contains is called London.server1-BUS1.
- A queue-type bus destination called ServiceIntegrationQueue1, which is one of the destinations in BUS1.
- Queue managers called QM01 and QM02 which are part of a network of interconnected IBM MQ queue managers and queue-sharing groups. If you have only one queue manager then you can ignore references to QM02 in this sample.
- The IP host name for the server where QM01 runs is PARIS.
- A queue called WMQ11 which is located on QM01 and a queue called WMQ21 which is located on QM02. There might be many other queues defined in the IBM MQ network but this sample is concerned only with the two IBM MQ queues that you are going to access from WebSphere Application Server.
You select London.server1-BUS1 to be the gateway messaging engine and QM01 to be the gateway queue manager.
Sample configuration for the connections
- The commands that your IBM MQ administrator
uses to configure the IBM MQ components
that correspond to the IBM MQ link:
- The sender channel
- The receiver channel
- The transmission queue
- The parameters that you need when you use the WebSphere Application Server administrative console to
configure:
- A foreign bus connection, which includes the foreign bus representing the network of IBM MQ queue managers and queue-sharing groups, and the IBM MQ link representing the connection to that network
- JMS destinations that identify queues in the IBM MQ network
After you configure and activate these components your applications can exchange messages between WebSphere Application Server service integration messaging and IBM MQ messaging. Optionally you can configure additional administrative artifacts that allow you more detailed control over the queues and destinations, see Sample configuration for the destinations.
- IBM MQ command to configure the sender channel
Your IBM MQ administrator chooses the name for the sender channel, which in this sample is QM01.TO.BUS1.DEFINE CHL(QM01.TO.BUS1) + CHLTYPE(SDR) + TRPTYPE(TCP) + CONNAME('LONDON(5558)') + XMITQ(BUS1)
The CONNAME parameter specifies the IP host and port of the gateway messaging engine.
The XMITQ parameter specifies the name of the transmission queue, which is normally the same as the virtual queue manager name of the service integration bus, which is preferably the same as the bus name.
- IBM MQ command to configure the receiver channel
Your IBM MQ administrator chooses the name for the receiver channel, which in this sample is BUS1.TO.QM01.DEFINE CHL(BUS1.TO.QM01) + CHLTYPE(RCVR) + TRPTYPE(TCP)
- IBM MQ command to configure the transmission queue
Your IBM MQ administrator chooses the name for the transmission queue, but it is convenient to use the name of the service integration bus BUS1. If the service integration bus name is not a valid IBM MQ queue manager name then the WebSphere Application Server administrator must define a different virtual queue manager name for use here.DEFINE QL(BUS1) + USAGE(XMITQ)
- IBM MQ JMSAdmin command to configure the JMS destination
Your IBM MQ JMS applications can use this JMS destination to send messages to the service integration bus destination ServiceIntegrationQueue1 in BUS1.DEFINE Q(ServiceIntegrationQueue1) + QMGR(BUS1) + QUEUE(ServiceIntegrationQueue1)
- WebSphere Application Server parameters for the foreign bus connection
- You configure a foreign bus connection as part of the topology
of the service integration bus. For this sample, the service integration
bus is BUS1 and the foreign bus connection uses the following settings:
There are other options in the wizard relating to publish/subscribe messaging and security. Leave these settings to default.Setting Value Bus connection type Direct connection Foreign bus type IBM MQ Messaging engine to host the connection London.server1-BUS1 Virtual queue manager name BUS1 (use the name of the local bus) Foreign bus name QM01 (use the name of the IBM MQ gateway queue manager) MQ link name TO.QM01 Enable Service integration bus to IBM MQ message flow Checked (default) IBM MQ receiver channel name BUS1.TO.QM01 Host name PARIS Port 1414 Enable IBM MQ to Service integration bus message flow Checked (default) IBM MQ sender channel name QM01.TO.BUS01
- WebSphere Application Server parameters for JMS destinations
- You configure JMS destinations to allow service integration JMS
applications to access queues in the IBM MQ network. This sample needs
JMS destinations for queue WMQ11 on queue manager QM01, and for queue
WMQ21 on queue manager QM02.
Note that these JMS destinations are IBM MQ queues but for the purposes of this sample you are accessing these queues from service integration JMS programs so you need to define JMS destinations for the default messaging provider (service integration) not for the IBM MQ JMS provider.
For WMQ11, configure the following parameters:
Leave all other settings to default.Parameter Value Name WMQ11 JNDI name jms/WMQ11 Bus name QM01 Queue name WMQ11 For WMQ21, configure the following parameters:
Leave all other settings to default.Parameter Value Name WMQ21 JNDI name jms/WMQ21 Bus name QM01 Queue name WMQ21@QM02
Sample configuration for the destinations
- The IBM MQ JMS destination points to a IBM MQ queue (actually a remote or alias queue) which points to the service integration destination.
- The service integration JMS destinations point to service integration destinations (actually foreign or alias destinations) which point to the IBM MQ queues.
Refer to the IBM MQ documentation for information about when and how to define remote and alias queues.
- WebSphere Application Server parameters for foreign destinations
- You configure foreign destinations for IBM MQ queues to allow control
over how service integration applications access each queue. For
example, you can configure foreign destinations for each of two queues
and specify that service integration includes an MQRFH2 header in
messages to one queue but not to the other.
You configure foreign destinations as destination resources of the service integration bus.
For WMQ11, configure the following parameters:
Leave all other settings to default.Parameter Value Identifier WMQ11 Bus QM01 For WMQ21, configure the following parameters:
If the foreign destination is a IBM MQ destination, the identifier must be in the form qName@qmName where qName is the name of the queue and qName is the name of the queue manager. For this example, the identifier for WMQ21 on queue manager QM02 is WMQ21@QM02.Parameter Value Identifier WMQ21@QM02 Bus QM01 Leave all other settings to default.
After you define these foreign destinations you can, for example, set the _MQRFHAllowed custom property for either destination or both, as required.