Search My Ramblings

Thursday, January 23, 2014

Working with XML payloads in JMS queues from Oracle Service Bus

For some this may seem intuitive and obvious, but wasn't for me as an experienced Java developer for many years.  Having worked in JMS I recalled that the message types supported generally included Text, Object, Bytes, Stream, and Map.  So when I wanted to create both a publisher and subscriber in Oracle Service Bus to a queue I naturally configured each to use a "Text" message type.  This caused me issues in that the queue subscribing Proxy service message flow needed to have a Replace action early in the request pipeline that changed the $body from a text representation of the XML in the queue to an actual XML document using

Replace . in body with {fn-bea:inlinedXML($body)}

This does work.  However, I later realized that OSB has an additional layer of interpretation on top of JMS where if you configure the message type in both the Proxy service subscriber as well as the Business service publisher to use an "XML" message type, OSB will naturally handle and interpret the XML payload in the JMS queues appropriately, greatly simplifying your life.

I hope this helps and saves you some time in getting OSB working well with JMS.  Enjoy!

No comments: