Reputation: 833
Is it possible to read custom headers/property values from inbound JMS and/or AMQP messages ? How is this accomplished ? We currently use headers for routing purposes in Apache Camel so I need to do the same thing with WSO2 ESB. Thank you.
Upvotes: 0
Views: 183
Reputation: 703
To complete the answer of @Jean-Michel you have to use CAMEL_CASe for your header
<log level="custom">
<property name="jms_timestamp" expression="get-property('transport', 'JMS_TIMESTAMP')"/>
<property name="jms_message_id" expression="get-property('transport', 'JMS_MESSAGE_ID')"/>
<property name="jms_destination" expression="get-property('transport', 'JMS_DESTINATION')"/>
<property name="jms_expiration" expression="get-property('transport', 'JMS_EXPIRATION')"/>
<property name="jms_delivery_mode" expression="get-property('transport', 'JMS_DELIVERY_MODE')"/>
</log>
Result :
jms_timestamp = 1637588070662, jms_message_id = ID:AMQP_NO_PREFIX:283e7b13cbaa4ad0b8bccb2c525b6705, jms_destination = testwso2/Subscriptions/mySubscription, jms_expiration = 1638797670662, jms_delivery_mode = 1
Upvotes: 0
Reputation: 5946
use this expression to read your jms header :
get-property('transport','YOUR_JMS_HEADER_NAME')
sample :
<log level="custom">
<property name="my jms property" expression="get-property('transport', 'YOUR_JMS_HEADER_NAME')"/>
</log>
Upvotes: 2