In this post..
I hope to describe how to attach non standard JMS headers/properties onto a queue, and then read these off at the next flow. This post assumes the following prior knowledge:- How to create Business service's that write to JMS Queue's
- How to create Proxy service's that read from a JMS Queue
- A JMS Queue set up on your server -> Mine is called 'example'
Possible uses:
- Passing additional information between flows
- Storing properties which can be used for message selectors
First, create a proxy flow which takes a request and then writes the message to a queue via a business service - Complete flow images at bottom of post.
Next, create a proxy flow which will pull the message from the queue - Complete flow images at bottom of post.
Now we have the basic setup for our flows.
When you set the transport headers, they are stored as properties attached to the message, these can then be used with message selectors, or just data that needs to be passed onto a further flow.
To add a custom JMS header/property you will need to add a 'Transport Header' action. You need to place this within the routing / publish / service callout which writes the message to the queue.
The flow for reading a message off the queue looks as follows, this will get the message, assign the message property, and then log it:
To read the property, you need to do two things:
1. On the proxy Service Transport configuration page, tick the 'yes' box next to get all headers:
2. You will need to use the following XQuery to pull it off the incoming message:
$inbound/ctx:transport/ctx:request/tp:headers/tp:user-header[@name='PROPERTY_NAME']/@value
Replacing PROPERTY_NAME with the name specified on the transport header used to write to the queue.
Below is an image of how the proxy flows look:




