Wednesday, February 5, 2020

12c SOA - set custom jms header property in Mediator and BPEL components and message selector syntax for jms consume

By Default a JMS message includes a number of header fields that contain information used to identify and route messages. The supported headers for an incoming message are:
JMSCorrelationID
JMSDeliveryMode
JMSExpiration
JMSMessageID
JMSPriority
JMSRedelivered
JMSTimestamp
JMSType

But we can also set Custom properties.

Mediator: To set custom JMS header property in Mediator follows below steps.

Open .mplan file and click on assign activity. Here we are defining new custom header property (city).
To set city custom header property choose “jca.jms.JMSProperty” and append “.city” to it. You can assign any expression or hard-code this property value.

BPEL: To set custom JMS header property in BPEL follows below steps.
Go to *.bpel file, check the invoke code and add a new property called jca.jms.JMSProperty.Profession, for instance:

<invoke name="InvokeJMS" inputVariable="InvokeJMS_Produce_InputVariable"
                partnerLink="JMSProduce" portType="ns1:Produce_Message_ptt"
                operation="Produce_Message" bpelx:invokeAsDetail="no">
                 <bpelx:inputProperty name="jca.jms.JMSProperty.Profession" variable="profVar"/>
</invoke>

Currently this property is equal to profVar but you can also use expression to assign value to city property.
 <bpelx:inputProperty name="jca.jms.JMSProperty.Profession" expression="2"/>

Remember you will not find this property in header tab, you need to manually set this property in *.bpel file for specific invoke.

When you will run the composite, you will see custom JMS header property at admin console for that queue.

Deploy and Test:
 In JMS queue weblogic console
 Consume message using message selector 

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...