我有一个非常简单的流程,我试图比较入站属性和有效负载,它们是选择组件内的整数,尽管值相同,但是选择组件将其路由到默认部分。
我想得到一些帮助来完成这项工作
提前谢谢
<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<flow name="flow_testFlow1" doc:name="flow_testFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<set-payload value="#[12]" doc:name="Set Payload"/>
<set-property propertyName="trial" value="#[12]" doc:name="Property"/>
<choice doc:name="Choice">
<when expression="#[payload == message.inboundProperties['trial']]">
<logger level="INFO" doc:name="Logger" message="Success"/>
</when>
<otherwise>
<logger level="INFO" doc:name="Logger" message="error"/>
</otherwise>
</choice>
</flow>
</mule>
答案 0 :(得分:3)
set-property
设置出站范围内的属性,入站范围是只读的(由入站端点创建)。
所以你需要修改你的选择路线表达式:
<when expression="#[payload == message.outboundProperties['trial']]">
然后它有效。