In previous post, you have seen using the JMS transport in business service to enqueue messages into JMS queue. In this post, you will use JMS Transport in proxy service to read/poll messages from JMS queue. The OSB project used for demonstration can be downloaded from this link.
Since DemoQueue has enqueued message (seen in previous post), you will read the same message using a proxy service and route it to another business service which enqueues into DemoQueue1. So create another JMS queue and required JMS resources and create new business service in similar fashion as described in previous post. Set endpoint URI to point to DemoQueue1.
Create Proxy Service and select JMS as Transport Protocol. Set endpoint URI to point to DemoQueue and Connection Factory.
Go to JMS Transport tab. Select Queue as destination type and uncheck Is Response Required as you are not expecting response from business service.
Go to Message Flow tab. Drag Publish activity and select new business service in properties. The Publish activity is used for one-way communication and here it routes the JMS message to business service.
Deploy OSB project and observe that proxy service read the message from DemoQueue and enqueued into DemoQueue. Here your proxy service acts as a MDB that polls your JMS queue for the messages.
I am not able to see the images.can you please upload it again..
Will do it in some time
Uploaded the images and also included the sample project link.
Hi Siva : Do you any similar article which demonstrates the steps to connect to the external JMS provider like MQ . Here the JMS resources are weblogic , but in my case the Topics and Queue reside on external IBM MQ server ??
For MQ, you have to use MQ connection resource. The fields that it asks for while creating this connection resource is more or less self-explanatory. Don’t forget to include MQ related jars in weblogic.
Can we use proxy service to read messages one by one.
proxy service does read the messages 1 by 1 from the JMS Queue. what exactly you mean one by one? Do you want a message to be read only when previous message is processed by OSB?
Thanks svgonugu for your reply.
My requirement is to make a asynchronous call to OSB,so looking to implement with JMS.Once producer publish the message, proxy service is suppose to forward the messages to different webservices/backend.
We are not expecting any kind of response from backend. Only have to pass an acknowledge to producer once proxy services have successfully forwarded the message.
Any help from your side would be much appreciable.
That’s true that you can use JMS for asynchronous call to OSB. OSB proxy service processes the message one by one. Either it’s the acknowledgment or the response you want to give to the producer, you should be using another JMS queue to push that ACK or Response. And producer should be able to read from that JMS queue.
Hi svgonugu,
Can you plaese provide how to read JMS messages from queue using proxy service.
Create XML/Message proxy service based on ur requirement, use JMS transport and give the endpoint as http://hostname:port/connectionfactory jndi/queuename jndi. you can also have a look at the following article where it talks about the business service. In similar fashion you can create proxy service.
http://www.oracle.com/technetwork/articles/soa/schmutz-osb-cookbook-1543518.html
can I read jms queue with Business Service. The example given by you is other way around?
proxy service has to be used to read the message from jms queue.