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:
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.
Consume message using message selector
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
No comments:
Post a Comment