我試着去訪問從會話變量設置成其它的流程的價值如何在騾子上使用其他流量的變量值?
代碼:
<flow name="test" doc:name="test" >
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081/services/autocomplete" connector-ref="" transformer-refs="transform" doc:name="HTTP">
</http:inbound-endpoint>
<set-variable variableName="req" value="#[message.inboundProperties['http.query.string']]" doc:name="Variable"/>
<set-session-variable variableName="message" value="test" doc:name="Set Message ID"/>
<http:outbound-endpoint host="teste.local" path="newlocation/autocomplete?#[groovy:return req.toString();]" port="8080" user="login" password="1234" exchange-pattern="request-response" doc:name="HTTP">
</http:outbound-endpoint>
</flow>
和其他流動試圖打印:
<flow name="test2" doc:name="test2" >
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081/services/autocomplete2" connector-ref="" transformer-refs="transform" doc:name="HTTP">
</http:inbound-endpoint>
<set-variable variableName="req" value="#[message.inboundProperties['http.query.string']]" doc:name="Variable"/>
<logger message="#[sessionVars.message]" level="INFO" doc:name="Logger"/>
<http:outbound-endpoint host="teste.local" path="newlocation/autocomplete?#[groovy:return req.toString();]" port="8080" user="login" password="1234" exchange-pattern="request-response" doc:name="HTTP">
</http:outbound-endpoint>
</flow>
但有一個錯誤saing有即使當我第一次嘗試訪問第一個url時,它也沒有設置到該流中的變量,所以我將它們更改爲第二個地方,以便創建會話。
- > mule version 3.4
嗨感謝您的反饋,這可能會回答我的問題,我會看看,試試,你有什麼樣的代碼,我可以基地開展地雷? –
已更新答案,並鏈接到示例配置。注意你需要通過Maven等添加objectstore模塊。 –
那麼我不能找到objectStore的模式...所以它一直給我一個錯誤,現在mulesoft只是不提供它...任何線索我在哪裏可以找到它? –