Oracle SOA Suite JMS Adapter : Setting/Getting Custom JMS Properties

Oracle SOA Suite provides for a variety of technology adapters based on the JCA framework that we can leverage while designing business processes in either Oracle SOA or BPM Suite.

There are a wide variety of adapters for processing messages in and out from DB, JMS, File Systems, AQs, socket etc.

Although Oracle has a seemingly exhaustive documentation on how to use each one of them, I recently found out that there are some very important things that are missing from Oracle Fusion Middleware documentation.

While working with the JMS adapter in my business process I was required to get and set some custom properties in my JMS message. I was truly disappointed when even after searching the technology specifications i wasn’t able to find a way to do it.

I finally managed to get it working and in this blog post i will show how we can set or get custom JMS properties to a message while inserting it into a JMS queue or reading from it.

Let me start with a very basic order booking composite application that saves orders to a jms queue. The need is to pass some custom user headers along with the order payload.

image

The Custom JMS Headers/Properties is passed from the Mediator component to the JMS Adapter service.

Open on the Mediator .mplan file in JDeveloper. In the Static Routing pane click on the Assign Values icon that opens the assignment wizard.

Custom JMS Headers can be get/set by using the following expression in Mediator

$in.property.jca.jms.JMSProperty.<CustomPropertyName>

is where you set/get the name of custom JMS Property

The property value can be assigned to any variable in the component and similarly a value can be assigned to the property from any component variable

image

Compile, deploy and then invoke the composite with an HTTP SOAP request. Once the message is enqueued in the JMS queue.

Login to the weblogic console and check the queue for the order booking jms message.

You’ll notice that the Custom Properties are set in the JMS message along with the standard JMS Headers

image

If you want to use a JMS Adapter to consume message inside a composite you can get the custom properties in a similar way.

.

2 thoughts on “Oracle SOA Suite JMS Adapter : Setting/Getting Custom JMS Properties

If you have any comments, suggestions or feedback about the post, please feel free to type it here and I will do my best to address them asap

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s