The Service Component Architecture (SCA) framework provides three different
types of bindings to choose from for SCA import:
This article shows you how to use the WebSphere MQ JMS binding to implement publish/subscribe messaging for seamless integration of events and data. The steps in this article will work on WebSphere MQ V7 or later and WebSphere ESB V6.2 or later.
The example below uses a simple customer order business object . The diagram shows the overall scenario. A real-world scenario might have MQ Export and MQ-JMS Import in separate modules, and a more complex object structure. The goal here is to show how MQ-JMS binding helps implement publish/subscribe messaging.
This article showed you how to use MQ Export and MQ-JMS Import bindings to implement publish/subscribe messaging using the underlying WebSphere MQ platform.
- MQ Binding
- MQ JMS Binding
- JMS Binding
This article shows you how to use the WebSphere MQ JMS binding to implement publish/subscribe messaging for seamless integration of events and data. The steps in this article will work on WebSphere MQ V7 or later and WebSphere ESB V6.2 or later.
The example below uses a simple customer order business object . The diagram shows the overall scenario. A real-world scenario might have MQ Export and MQ-JMS Import in separate modules, and a more complex object structure. The goal here is to show how MQ-JMS binding helps implement publish/subscribe messaging.
You can download the complete working solution at the bottom of the article. You will still need to complete the prerequisite steps below if you download and test the module. The CustomerOrder business object (BO) used in this article looks like this:
Prerequisite steps
Complete the following steps before starting the development:- Make sure that WebSphere MQ is running. If the default configuration was created when WebSphere MQ was installed, you might already have a queue manager created. If not, create a new queue manager.
- Create three local queues as shown below:
- Create a Topic named
TMS.CUSTOMERORDER
with Topic StringTMS/CUSTOMERORDER/#
: - Create the following two subscriptions to the topic, where the
endpoints are the two queues defined in Step 2:
- Make sure the WebSphere ESB server is running and log in to the Administrative Console using the admin user ID.
- Select Resources => JMS => Topic connection factories:
- Click New and provide the details as shown below:
- Make sure that Transport selected is Client. Bindings type does not work with a local queue manager (coexisting on the same server as WebSphere ESB).
- Make sure that the WebSphere MQ messaging provider is selected:
- Click OK and save the configuration
- Select Resources => JMS => Topics:
- Click New and provide the information as shown below:
- Make sure that the Topic String defined while setting up the Topic in WebSphere MQ is used to specify the Topic Name in the above step.
Developing the solution
- Create a new Mediation Module project named
MQPubSubModule
. In actual project scenarios, you will create a new library and create the BOs and interfaces inside the library for better modularization. Since this is a demo, the necessary artifacts are created directly in the mediation module. - Define a new BO named
CustomerOrder
: - Define a new interface named
CustomerOrderService
with only one operation -- a one-way operation to demonstrate the publish/subscribe scenario: - Select the defined BO as input while defining the interface.
- Open the assembly diagram.
- Drag and drop MQ binding from the Inbound Exports drawer onto the canvas.
- Specify the following properties while configuring the MQ Export. The
screenshots below show the details after the MQ Export is completely
configured. You provide the values shown below while configuring the
MQ Export wizard:
- Select the Interface defined earlier:
- Specify the Bindings as shown below:
- Specify the Endpoint Configuration as shown below. Values for
your environment may be different. Make sure that the
Transport is Client and that Enable connection at
startup is checked:
- For Method Binding, select UTF8XMLHandler:
- Keep Security Attributes as blank:
- The final Summary page should look like this:
- This sample uses the Specify properties option while configuring MQ Export
- Select the Interface defined earlier:
- MQ Import supports only the point-to-point model, and therefore this example uses MQ JMS Import to demonstrate the publish/subscribe messaging model.
- Drag and drop MQ JMS binding from Outbound Imports drawer on to the canvas.
- Specify the following properties while configuring the MQ JMS import. The screenshots below show the details after the MQ JMS import is completely configured. You provide the values shown below while configuring the MQ JMS Import wizard.
- In actual projects, the interface on MQ Export and MQ JMS Import may
be different, and you may need to use a mediation flow in between to
map source to target. To keep things simple, this example assumes that
the export and import use the same interface.
- Select the interface defined earlier:
- Specify the Bindings details as shown below:
- Specify the Endpoint Configuration details as shown below. Use the
already configured JNDI details:
- Specify the Method Bindings as shown below:
- Keep the Security Attributes empty and leave the message
configuration as-is. The Summary screen should like this:
- Select the interface defined earlier:
- Wire the export to the import, which adds the following entry on the
MQ Export:
- Deploy the mediation module to the WebSphere ESB server
Testing the solution with WebSphere MQ Explorer
- Open WebSphere MQ Explorer if it is not already open.
- Connect to the queue manager on which the queues are defined.
- Right-click on the CUSTOMERORDER.NOTIFY queue and select Put
test message:
- Use the following XML message for testing:
C1000 O1000 P1000 10 3.14167 - Make sure that the line breaks are removed before placing the message
on the queue:
- Click Put message.
- Close the window and click Browse on either of the two destination queues.
- The Message Data window shows the following details:
- Double-click on any message and click on Data on the window
that opens:
- Copy and paste the data from the Message data field into a text
editor. The response should look like this:
C1000 O1000 P1000 10 3.14167
Conclusion
This article showed you how to use MQ Export and MQ-JMS Import bindings to implement publish/subscribe messaging using the underlying WebSphere MQ platform.
This article is very much helpful and i hope this will be an useful information for the needed one.Keep on updating these kinds of informative things Biztalk online training hyderabad
ReplyDelete