JMS queue and Topics are mainly used for persistence and
reliability, we use JMS adapter to connect to JMS queue or topic in SOA Suite
but in OSB we use jms protocol to connect to JMS queue and topic, we can also
use JCA adapter but jms protocol is always preferred. We usually deals with XML or Non-XML content
while working with JMS queue and topic and there are some pre-defined header
properties for JMS queue and topic that are used for specific purpose.

Sometime we come across a requirement where we need to read
extra parameters from JMS queue/topic, these extra parameters are custom JMS
header properties. We can read custom header property for JMS queue in OSB.

In this post, we show how to read custom JMS header
properties in OSB. For this post, we created one sample queue (TargetQueue) on
local server and we put the message to this queue along with custom header
property. We created one OSB project in eclipse under OSB configuration and
created required folder structures.

In previous post, we see how we see set custom header
property for JMS queue. Click here to read that post.

First create proxy service that will read the message from
JMS queue, to create that right click on the proxy folder and click on new and
choose proxy service option. Choose “Messaging service” as Service Type.

In Message Type configuration, select “Text” as Request
Message Type as we will read simple text message to test this use case and
choose “None” as Response Message Type as we are not sending any response back
once we read the message from JMS queue.

In Transport tab, choose jms from protocol drop-down as
we are dealing with JMS queue i.e. we need to read the message from JMS queue.
In Endpoint URI text box fill the required values for JMS endpoint URI, for
this use case we use default connection factory and TargetQueue JMS queue.
Choose default settings for all other tabs and save the business service.

Make sure that “Get All Header” option is set to yes as
we need to read JMS header properties. If we don’t select this option then we
not able to read the custom header property from JMS queue.

About Me

Disclaimer

This blog is solely owned by me and it does not represent any company or customer work. This blog is result of the POC's which I keep on doing during my spare time. Please feel free to reach out to me in case you have any concern regarding material in this blog.