you will find this corelationId in the transport scope :
get-property('transport','JMS_COORELATION_ID')
题
I have created a queue in activeMQ and also created a proxy service which is listening for messages on that queue.
While testing, I have put up a sample message to ActiveMQ queue using the console provided by ActiveMQ and set its corelationId but I am unable to retrieve the same corelation ID in the proxy service.
Below is the proxy code to retrieve the same.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="JMSQueueConsumer"
transports="jms"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="custom">
<property name="corelationId" expression="get-property('JMS_COORELATION_ID')"/>
</log>
<property name="OUT_ONLY" value="true" scope="default" type="BOOLEAN"/>
</inSequence>
</target>
<parameter name="transport.jms.Destination">WSO2InQueue</parameter>
<description/>
</proxy>
In the logs I am getting the value of "corelationId" as null.
Can anybody help me on this?
解决方案
you will find this corelationId in the transport scope :
get-property('transport','JMS_COORELATION_ID')