Tuesday, June 5, 2012

OSB hands on: JMS Producer Consumer Example

In this blog I have tried to show how we can use OSB business service and Proxy service to implement a JMS producer consumer example. Our objective is to build an OSB project which will do the following.
OSB_JMS
Create a sample Schema which represents data structure to be used
We need to create a Simple Schema which is used for reading and Writing data from JMS Queue/Topic

Configure “JMSProducerBIZ” OSB business Service:
Step 1: In General Configuration Tab use “Messaging Service” as Service Type.
image
Step 2: In Messaging tab use “xml” as “Request Message Type”. Above created XSD is used for the xml request.
image
Step 3: In Transport configuration tab make below configuration. Please follow my earlier post for configuring JMS Topic and Queue. Follow below link http://anindyabhattacharjee.blogspot.in/2012/04/configuring-jms-for-publish-and.html
image
Step 4: In JMS transport tab make below Configuration
image
Configure “JMSProducerToTopicBIZ” business service :
Step 1 and Step 2 remains same as mentioned in above configuration steps. In “Transport Configuration” we need to keep below configuration settings.
image
we have to make JMS Transport configuration settings like below 
image
Configure “JMSConsumer.proxy” Service
Step 1: Make Service type as “Messaging Service” in General configuration tab.
image
Step 2: Make transport configuration as below. I have removed host and port from below snap as it is confidential.
image
Step 3: Make “JMS Transport Configuration” as below.
image
Step 4: At last message flow looks like as below. Routing node is used to write data in Topic.
image

Test:
we need to Check how many messages are present currently in “DestinationQueue”. Below snap says total 9 messages are present in Queue.
image
Run “JMSProducerBIZ” Business Service from OSB console and as a result we have 10 total messages in DestinationQueue.
image
DestinationQueue: After execution of business service
image
During my previous tests,  9 messages are consumed so far. So 10th message will go to Topic.
Destination Topic: image
image

6 comments: