0

我有一个非常简单的流程,我尝试比较入站属性和有效负载,它们是选择组件内的整数,尽管选择组件将其路由到默认部分的值相同。

我想得到一些帮助来完成这项工作

先感谢您

<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>
4

1 回答 1

3

set-property在出站范围中设置属性,入站范围是只读的(由入站端点创建)。

因此,您需要像这样修复您的选择路线表达式:

<when expression="#[payload == message.outboundProperties['trial']]">

然后它就起作用了。

于 2014-08-21T15:46:01.423 回答