WAS v8.5 > Reference > Administrator examples

WebSphere MQ link sample configuration

This sample configuration illustrates how we can use a WebSphere MQ link to connect WAS service integration messaging to WebSphere MQ messaging.

A WebSphere MQ link connects one service integration messaging engine, called the gateway messaging engine, to one WebSphere 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 WebSphere MQ network; all queue managers and queue-sharing groups in the WebSphere MQ network use the gateway queue manager to route messages to and from the service integration bus.

Typically, a WebSphere MQ link consists of two TCP/IP connections:

WebSphere MQ calls these TCP/IP connections message channels, a receiver channel which connects to the WebSphere MQ link sender channel and a sender channel which connects to the WebSphere MQ link receiver channel. The following figure shows a configuration like the one just described, with a WebSphere MQ link sender channel called BUS1.TO.QM01 and a WebSphere MQ link receiver channel called QM01.TO.BUS1.

If you only require messages to flow in one direction, you need only define one TCP/IP connection. For example, a WebSphere MQ link sender channel in service integration that connects to a receiver channel in WebSphere MQ is enough to support message flow from service integration to WebSphere MQ. However, this sample builds a configuration that allows messages to flow in both directions.


Sample configuration context

The purpose of this sample is to connect a WAS configuration to a WebSphere MQ configuration so that asynchronous messages can flow in both directions between the two messaging systems. The sample assumes that we have already set up a WAS configuration like this:

The sample also assumes that you already have a WebSphere MQ configuration like this:

You select London.server1-BUS1 to be the gateway messaging engine and QM01 to be the gateway queue manager.


Sample configuration for the connections

This section describes the settings that you or your WebSphere MQ administrator need to configure for the connections:

After you configure and activate these components the applications can exchange messages between WAS service integration messaging and WebSphere MQ messaging. Optionally we can configure additional administrative artifacts that allow you more detailed control over the queues and destinations, see Sample configuration for the destinations.

WebSphere MQ command to configure the sender channel

DEFINE    CHL(QM01.TO.BUS1) +
          CHLTYPE(SDR) +
          TRPTYPE(TCP) +
          CONNAME('LONDON(5558)') +
          XMITQ(BUS1)
Your WebSphere MQ administrator chooses the name for the sender channel, which in this sample is QM01.TO.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.

WebSphere MQ command to configure the receiver channel

DEFINE    CHL(BUS1.TO.QM01) +
          CHLTYPE(RCVR) +
          TRPTYPE(TCP)
Your WebSphere MQ administrator chooses the name for the receiver channel, which in this sample is BUS1.TO.QM01.

WebSphere MQ command to configure the transmission queue

DEFINE   QL(BUS1) +
         USAGE(XMITQ)
Your WebSphere 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 WebSphere MQ queue manager name then the WAS administrator must define a different virtual queue manager name for use here.

WebSphere MQ JMSAdmin command to configure the JMS destination

DEFINE   Q(ServiceIntegrationQueue1) +
         QMGR(BUS1) +
         QUEUE(ServiceIntegrationQueue1)
Your WebSphere MQ JMS applications can use this JMS destination to send messages to the service integration bus destination ServiceIntegrationQueue1 in BUS1.

WAS 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:
Set Value
Bus connection type Direct connection
Foreign bus type WebSphere 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 WebSphere MQ gateway queue manager)
MQ link name TO.QM01
Enable Service integration bus to WebSphere MQ message flow Checked (default)
WebSphere MQ receiver channel name BUS1.TO.QM01
Host name PARIS
Port 1414
Enable WebSphere MQ to Service integration bus message flow Checked (default)
WebSphere MQ sender channel name QM01.TO.BUS01
There are other options in the wizard relating to publish/subscribe messaging and security. Leave these settings to default.

WAS parameters for JMS destinations

You configure JMS destinations to allow service integration JMS applications to access queues in the WebSphere MQ network. This sample needs JMS destinations for queue WMQ11 on queue manager QM01, and for queue WMQ21 on queue manager QM02.

Note these JMS destinations are WebSphere 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 WebSphere MQ JMS provider.

For WMQ11, configure the following parameters:
Parameter Value
Name WMQ11
JNDI name jms/WMQ11
Bus name QM01
Queue name WMQ11
Leave all other settings to default.

For WMQ21, configure the following parameters:
Parameter Value
Name WMQ21
JNDI name jms/WMQ21
Bus name QM01
Queue name WMQ21@QM02
Leave all other settings to default.


Sample configuration for the destinations

The sample JMS destinations in Sample configuration for the connections point directly to the corresponding WebSphere MQ queues and service integration destinations. If you prefer, we can configure additional components so that:

Refer to the WebSphere MQ documentation for information about when and how to define remote and alias queues.

WAS parameters for foreign destinations

You configure foreign destinations for WebSphere MQ queues to allow control over how service integration applications access each queue. For example, we 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:
Parameter Value
Identifier WMQ11
Bus QM01
Leave all other settings to default.

For WMQ21, configure the following parameters:
Parameter Value
Identifier WMQ21@QM02
Bus QM01
If the foreign destination is a WebSphere 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.

Leave all other settings to default.

After you define these foreign destinations we can, for example, set the _MQRFHAllowed custom property for either destination or both, as required.


+

Search Tips   |   Advanced Search