Introduction:
The WebSphere® MQ binding provides Service Component Architecture (SCA) connectivity with WebSphere MQ applications. Use the WebSphere MQ export and import bindings to integrate directly with a WebSphere MQ-based system from your server environment. This eliminates the need to use MQ Link or Client Link features of the Service Integration Bus. When a component interacts with a WebSphere MQ service by way of an import, the WebSphere MQ import binding uses a queue to which data will be sent and a queue where the reply can be received.
When an SCA module provides a service to WebSphere MQ clients, the WebSphere MQ export binding uses a queue where the request can be received and the response can be sent. The function selector provides a mapping to the operation on the target component to be invoked.
Conversion of the payload data to and from an MQ message is done through the MQ body data handler or data binding. Conversion of the header data to and from an MQ message is done through the MQ header data binding.
Overview:
In this article we are going to implement the scenario where we are getting order details from one MQ queue called ExportQ, We are generating Oder ID in the business process and updating the order details in other Queue called ImportQ.
As shown in the pic when the order details are pushed into ExportQ queue then our SCA module will be trigger the request. In our SCA application we are generating Order ID. Here we need to update the Order details into ImportQ, so to send the updated Order details into ImportQ we are using MQ binding.
Implementation:
To implement this scenario we need to complete the following steps.
- Create MQ Manager and two local Queues.
- Create Interface and Business Objects.
- Create and implement Business Process.
- Integrate the application using MQ binding.
- Test the application.
Create MQ Manager and two local Queues:
Open the IBM WebSphere MQ Explorer right click on MQ Manager then select New à MQ Manager.
Enter Queue manager name as MQMGR and click on Finish.
Expand the MQMGR queue manager right click on Queue select New à Local Queue.
Give Queue name as ExportQ and click on finish.
Similarly create other local queue called as ImportQ. The queues are look like below.
Create Interface and Business Objects:
Create two business Objects called as ‘OrderRequestBO’ and ‘OrderBO’ as shown below.
Create two Interfaces called ‘OrderProcessInterface’and ‘OrderService’ as shown below.
Create and implement Business Process:
Create Business Process called as ‘BP_OrderProcess’ and Implement as shown below.
Here we implemented our business Process for generating OrderId and Invoking OrderService which is going to update Order details in ImportQ.
Integrate the application using MQ binding:
This is the important section where we are configuring our MQ Bindings to receive message from ExportQ and Send the updated order details into ImportQ.
Open EAI_OrderProcessModule Assembly diagram right click on BP_OrderProcess then select Generate Export à Messaging Binding à MQ binding.
Now one window will open for Configure WebSphere MQ Export Service. Configure the MQ Binding as shown below.
Here we configured Queue Manager, Queue name and transport method. The host name and port is the system IP of the ExportQ exist.
The Data Format is to handle request message format, here we configured as XML format. The functional selector is used for select specific operation name in the interface.
Import Configuration:
Open EAI_OrderProcessModule Assembly diagram right click on BP_OrderProcess then select Wire Reference to New à Imports.
Right click on imported component then select Generate binding à Messaging Binding à MQ binding.
Now one window will open for Configure WebSphere MQ Import Service. Configure the MQ Binding as shown below.
Here we configured Queue Manager, Queue name and transport method. The host name and port is the system IP of the ImportQ exist.
The Data Format is to handle to send message format, here we configured as XML format. Finally the assembly diagram is look like below.
Test the application:
Open the RfhUtil V7 for test our application. RfhUtil used for push the message into Queue and browse the messages from the queue.
Request Message:
<?xml version="1.0" encoding="UTF-8"?><OrderRequest xmlns:ns0="http://EAI_Library" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:OrderRequestBO">
<ItemID>ITM123</ItemID>
<OrderDate>2013-09-08+05:30</OrderDate>
<Name>AMIR</Name>
<Address>HYD</Address>
<Description>MOBILE</Description>
</OrderRequest>
Enter Queue Manager, Queue Name, browse the request message file then click on Write Q.
If you want to see the request message click on Data and select XML from data format in RfhUtil.
Once we click on Write Q the request message will trigger to our SCA module and received from OrderProcessExport. In the Business process it will create the OrderId and will invoke the OrderService to update Order details in ImportQ. Here look the logs which we have written in Business Process.
Now browse the ImportQ, which is updated with order details as shown below. In RfhUtil enter Queue manager name as MQMGR, Queue name as ImportQ and click on Read Q. Goto Data select XML from Data format.
Conclusion:
This article described the concepts of the WebSphere Integration Developer V7 MQ Bindings feature. Here showed you the implementation steps and artifacts required to enable integration between SCA and MQ applications.
Download:
File Name
|
Description
|
Size
|
Download
|
MQ Binding.zip
|
MQ Binding Sample
|
22 KB
| |
Working with MQ Binding.pdf
|
MQ binding implementation in WPS
|
900 KB
|
2 comments :
Hi this is nageswara rao, can you please give me mediaiton module sample application, please help me my mail id nagmaram27@gmail.com
it's good article
Post a Comment