Authors: Rima Barman, Ujjwal Kumar
This article details the steps on creating integration using IBM WebSphere MQ, Integration Server and Universal Messaging. Using IBM WebSphere MQ, the user should be able to configure connections to MQ queues, listeners and notification documents. Listener will listen to the MQ queue, picks message and sends to the notification document. The notification document is pointing to UM. The IS trigger linked to notification document processes/enriches and sends messages to UM. IS consumes the enriched message or processes further.
- Any Developer with basic knowledge on IBM WebSphere MQ, Integration Server, Universal Messaging, Adapters and Designer
- Any Customer with basic knowledge on IBM WebSphere MQ, Integration Server, Universal Messaging, Adapters and Designer
IS & UM 10.5 and above.
a. Two Integration Servers (IS1, IS2)
b. Two Universal Messaging Realm Servers (UM1, UM2)
c. Two webMethods WebSphere MQ Adapters in IS1 and IS2 respectively
Install IBM WebSphere MQ and configure it
Install WebSphere MQ Adapter along with Integration Server and Universal Messaging using Software AG Installer in IS1 and IS2
Install the latest fixes
Add the below MQ jars in the IS classpath of IS1 and IS2 (IntegrationServer//packages/WmMQAdapter/code/jars/) to test functionality with WebSphere MQ JMS provider.
Start servers IBM WebSphere MQ, Universal Messaging and Integration Server
Data Flow of the Scenario
In this Integration scenario, message is sent from Integration Server1 to MQ Inbound queue through put adapter service using an active MQ Inbound connection. The MQ Inbound queue has a listener and an adapter notification document attached to it. The moment message is put to MQ Inbound, The listener, which is active, picks message from the MQ Inbound and sends it to the active inbound notification. The Notification which is pointing to Universal Messaging Server1 will send the message to UM1. At this moment, IS triggers a flow service to process and enrich the message and put the processed message to MQ Outbound. Then the active outbound listener listening to the outbound MQ will pick the message and sends to UM2 using active outbound notification. At this moment, The IS trigger of the Integration Server2 will fire which calls a service that reads the processed message. This message can be sent to a file or process further.
IBM WebSphere MQ Configuration
IBM MQ (formerly WebSphere MQ and MQSeries) is a messaging middleware. The following components needs to be created in MQ server to integrate with Integration Server, Universal Messaging and execute this scenario.
Open IBM MQ Explorer to create the following required configuration parameters to connect from Integration Server.
- MQ Queue Manager
a. Create a new Queue Manager by right-clicking on Queue Manger > New > Queue Manager
b. Enter the Queue Manager name and click on the Next button.
c. Enter Listener Port number in in the field “Listen on Port Number” and click on finish button.
- Server-Connection Channel
a. Create a new Server-Connection Channel under the Queue Manager by right clicking on Channels > New > Server-Connection Channel
b. Fill in the details and click on finish button (e.g., conn_Channel_01).
- MQ Inbound and Outbound queues for messaging
a. Create MQ Inbound queue under the Queue Manager by right clicking on Queues → New ->Local Queue
b. Fill in the name and click on finish button. e.g., Inbound_Queue_01
c. Create MQ Outbound queue e.g., Outbound_Queue_01 by following same steps.
IS and Adapter Configurations
One IS package should be created in Designer to configure the MQ Adapter in Integration Server. It should have folders adapters, connections, listeners, notifications, services and triggers e.g., MQ_BVT_01 (IS package name)
UM and IS Configurations
a) Create UM JNDI Connection Factory in UM Enterprise Manager e.g., EventFactory
b) Create two UM Queues e.g., JMS_Queue_01 in UM1 and JMS_Queue_02 in UM2
Update/Create IS Configurations for JMS in IS1 and IS2
a. Switch to IS Administration Page → Messaging.
b. Edit JNDI Provider Alias and update the Provider URL and save it (nsp://:) and test it.
c. Update JMS Connection Alias in JMS Settings and add new UM JNDI Connection factory e.g. EventFactory to it and save this.
d. Enable Default IS JMS Connection Alias
1. Create two MQ Adapter Connections
Adapter connections enable WebSphere MQ Adapter to connect to WebSphere MQ queues. Create two new Adapter connections by selecting the connection type as WebSphere MQ Connection and enable it.
Steps to create the Adapter connections:
• Switch to IS1 Administration UI-> Adapters → WebSphere MQ Adapter Page
• Select Connections tab and create a new Inbound Connection (Inbound_Connection_01) by selecting “Configure New Connections”, save it and enable it.
• Follow the same steps to create the Outbound connection (Outbound_Connection_01) in IS2
2. Create two MQ Adapter listenersAn adapter listener monitors the queue for messages and passes the messages to a listener notification. When a listener detects a message in a queue, the listener performs a Get/Put operation to retrieve the message and passes the message to the listener notification.
Create two new Adapter listeners:
Steps to create the Adapter listeners:
• Switch to the WebSphere MQ Adapter Administration Page of IS1
• Select the Listeners tab and create a new Inbound listener (Inbound_Listener_01) by selecting “Configure New Listener” → WebSphere MQ Single-Queue Listener
• Save the listener and enable it.
• Follow the same steps to create the Outbound listener (Outbound_Listener_01) in IS2
3. Create two MQ Adapter listener notificationsA listener notification works in conjunction with a listener to filter and process messages in WebSphere MQ Adapter.
Create two new Adapter listener notifications:
Steps to create the Adapter listeners notifications:
• Switch to Designer
• Move to project MQ_BVT_01 and right click on notifications folder and select → New → Adapter Notification. Enter name as “Inbound_Notification_01”
• Select adapter type as WebSphere MQ Adapter → WebSphere MQ Asynchronous Listener Notification → Inbound_Listener_01 → Inbound_Notification_01PublishDocument
• Click on the Finish button
• Switch to WebSphere MQ Adapter Administration Page and enable this notification
• Open the Adapter Settings property of the document and set properties for JMS using UM as mentioned below
• Follow the same steps to create the Outbound notification (Outbound_Notification_01) in IS2
4. Create Inbound Put Adapter ServiceThis Adapter service Inbound_Put_01 will be responsible to put messages to the inbound queue configured under the selected connection.
Create the new Adapter service Inbound_Put_01.
Steps to create this service:
• Switch to Software AG Designer and open package MQ_BVT_01
• Right click on folder notifications → New → Adapter Notification
• Fill in the details and click Next button.
• Select adapter type as WebSphere MQ Adapter and click on Next button.
• Select template as WebSphere MQ Asynchronous Listener Notification and click on Next button.
• Select listener as Inbound_Listener_01 and click on Next button.
• Check notification document name and click on Finish button.
• To enable the new listener notification document, switch back to the Integration Server WebSphere MQ Adapter page. Click on Listener Notification Tab. Enable the listener notification Inbound_Notification_01
5. Create Outbound Put Adapter ServiceThis Adapter service Outbound_Put_01 should be created in designer inside newly created package (ref. MQ_BVT_01 ) created by following same steps as point 4.
6. Create IS (flow) servicesa. put_MessageToInbound_01 in MQ_BVT_01 under the services folder. It invokes the adapter service created in point 4.
b. publishJmsMsgToMQInboundAndUM _02 will invoke the flow service that invokes Adapter service mentioned in point 6. This IS service will generate the main flow of this scenario.
c. processJmsInboundAndPutToMQOutbound will enrich the incoming message from MQ Inbound and put it to MQ Outbound
d. processJmsOutboundAndWriteToFile will process the incoming message from MQ Outbound and writes to a file
e. Create JMS triggers in triggers folder pointing to respective MQ notification documents.
- ISToUMPubMQInboundTrigger ->Inbound_Notification_01PublishDocument in IS1
- MQOutboundToFileTrigger → Outbound_Notification_01PublishDocument in IS2
f. Execute the flow service responsible (publishJmsMsgToMQInboundAndUM) to put message to MQ Inbound (step 6 b.)
Now here the data flow will be as follows:
MQ Inbound Queue >> MQ Inbound Listener >> UM Inbound >> Enrich Message >> MQ Outbound Queue >> MQ Outbound Listener >> UM Outbound >> IS Outbound Processing service
Summary & Next Steps
In this scenario, we had integrated WebSphere MQ Adapter with Integration Server and Universal Messaging. We were able to transfer messages from one Integration Server to an MQ server after which the messages were passed to UM and then enriched via IS service. The IS service then puts this message to another MQ whose listener will send this message to Outbound UM. This outbound can be received by the second IS or can be sent for further processing.
We can have similar scenarios like
Using IS Local Connection instead of JMS
Using webMethods (Native) Messaging instead of JMS
Transferring files as streams and recovering them Outbound MQ