我試圖用通過的MessageProcessor WSO2 ESB 4.6.0發送消息:
的Proxy->代理(商店) - >處理器 - >序列 - >代理
我在代理#1中設置了一個屬性('transport
'作用域),將它發送到代理#2,在那裏我可以成功記錄它,但隨後我通過採樣處理器將消息傳遞給代理#3,並且屬性正在丟失。
這是一個錯誤?我如何通過處理器發送'transport'屬性?
我希望value_1
在代理_3中出現而不是null
。WSO2 ESB:頭損失(SamplingProcessor)
<messageProcessor name="Processor_1" class="org.apache.synapse.message.processors.sampler.SamplingProcessor" messageStore="Store_1" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="interval">1000</parameter>
<parameter name="sequence">Sequence_1</parameter>
</messageProcessor>
MessageStore
Store_1 is InMemoryMessageStore
Proxy_1
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy_1" transports="jms" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="my_property_1" value="value_1" scope="transport"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
<endpoint>
<address uri="http://localhost:8280/services/Proxy_2" format="soap11" />
</endpoint>
</target>
<parameter name="transport.jms.Destination">Queue</parameter>
</proxy>
Proxy_2
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy_2" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="preserveProcessedHeaders" value="true"/>
<log level="custom" separator=",">
<property name="my_property_1" expression="get-property('transport', 'my_property_1')"/>
</log>
<store messageStore="Store_1"/>
</inSequence>
</target>
</proxy>
Sequence_1
<sequence xmlns="http://ws.apache.org/ns/synapse" name="Sequence_1">
<send>
<endpoint>
<address uri="http://localhost:8280/services/Proxy_3" format="soap11"/>
</endpoint>
</send>
</sequence>
Proxy_3
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy_3" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="custom">
<property name="my_property_1" expression="get-property('transport', 'my_property_1')"/>
</log>
<send/>
</inSequence>
</target>
</proxy>
謝謝@Chintana!我是否正確解決了在保存到MessageStore之前需要將傳輸屬性放在_SOAP Envelope Header_中的問題? – surlac
是的,您可以將它作爲SOAP Header元素或有效負載中的特殊元素。 –