Populating Custom JMS Properties/Headers in BPEL

JMS Message Headers or properties are easiest way to filter messages. Though JMS by default of few properties like messageID , Type, Co-relation id, we might need to set custom properties such as message country. This post talks about how set custom properties in BPEL1.1. and BPEL2.0

For Custom properties, on invoke we need to set custom property, jca.jms.JMSProperty.<propertyname>and value either as variable or expression. Though property is same in BPEL1.1. and BPEL2.0, Syntax is different.

BPEL 1.1:

1
2
3
4
<invoke name="PublishMessage" inputVariable="PublishMessage_Produce_Message_InputVariable" partnerLink="jmsReference"
portType="ns1:Produce_Message_ptt" operation="Produce_Message">
<bpelx:inputProperty name="jca.jms.JMSProperty.OrgCountry" variable="orgCountry"/>
</invoke>

BPEL 2.0

1
2
3
4
5
6
7
<invoke name="PublishMessage" partnerLink="jmsReference" portType="ns1:Produce_Message_ptt"
operation="Produce_Message" inputVariable="PublishMessage_Produce_Message_InputVariable"
bpelx:invokeAsDetail="no">
<bpelx:toProperties>
<bpelx:inputProperty name="jca.jms.JMSProperty.OrgCountry" variable="orgCountry"/>
</bpelx:toProperties>
</invoke>

Though you will not get any exception if you use syntax of BPEL1.1 in BPEL 2.0, property will not be set on message either. 

Leave Comment

Your email address will not be published. Required fields are marked *