Tuesday, June 5, 2012

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.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/TopicConfigure “JMSProducerBIZ” OSB business Service:
Step 1: In General Configuration Tab use “Messaging Service” as Service Type.
Step 2: In Messaging tab use “xml” as “Request Message Type”. Above created XSD is used for the xml request.
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
Step 4: In JMS transport tab make below ConfigurationConfigure “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.
we have to make JMS Transport configuration settings like below Configure “JMSConsumer.proxy” Service
Step 1: Make Service type as “Messaging Service” in General configuration tab.
Step 2: Make transport configuration as below. I have removed host and port from below snap as it is confidential.
Step 3: Make “JMS Transport Configuration” as below.
Step 4: At last message flow looks like as below. Routing node is used to write data in Topic.

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