我正在使用我的出站端点的成功范围。我得到了一个正确的反应,但是当它成功到达布尔值时,我的流量在下面给出
<flow name="testFlow1" doc:name="testFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test" doc:name="HTTP"/>
<until-successful maxRetries="5" failureExpression="#[message.inboundProperties['http.status'] != 200]" synchronous="true" doc:name="Until Successful">
<http:outbound-endpoint exchange-pattern="request-response" method="POST" address="www.example.com" doc:name="HTTP"/>
</until-successful>
<logger message="`From outbound #[payload]`" level="INFO" doc:name="Logger"/>
</flow>
</mule>
但我在logger中获得输出
From outbound true
答案 0 :(得分:0)
嗨,不确定会发生什么,但这是一个在3.6.0中运行的示例,它运行正常:
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9090" doc:name="HTTP Listener Configuration"/>
<spring:beans>
<spring:bean id="objectStore" class="org.mule.util.store.SimpleMemoryObjectStore"/>
</spring:beans>
<http:request-config name="HTTP_Request_Configuration" host="localhost" port="9090" doc:name="HTTP Request Configuration"/>
<flow name="zzzFlow1" >
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="#['laleros']" doc:name="Set Payload"/>
<logger message="*************************** #[payload]" level="INFO" doc:name="Logger"/>
<until-successful maxRetries="5" doc:name="Until Successful" synchronous="true">
<http:request config-ref="HTTP_Request_Configuration" path="/t" method="POST" doc:name="HTTP"/>
</until-successful>
<object-to-string-transformer doc:name="Object to String"/>
<logger message="*************************** #[payload]" level="INFO" doc:name="Logger"/>
</flow>
<flow name="tFlow1" >
<http:listener config-ref="HTTP_Listener_Configuration" path="/t" doc:name="HTTP"/>
<object-to-string-transformer doc:name="Object to String"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
以下是我得到的输出:
*******************************************************************************************************
* - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
*******************************************************************************************************
* zzz * default * DEPLOYED *
*******************************************************************************************************
INFO 2015-02-23 14:10:17,540 [[zzz].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: *************************** laleros
INFO 2015-02-23 14:10:17,593 [[zzz].HTTP_Listener_Configuration.worker.02] org.mule.api.processor.LoggerMessageProcessor: laleros
INFO 2015-02-23 14:10:17,670 [[zzz].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: *************************** laleros
只是仅供参考,我认为在http请求序列化响应后你需要变换器,因为它通常会将流作为有效负载返回。
HIH
答案 1 :(得分:0)
您对直到成功范围的定义需要进行额外的配置。 看一下下面的链接
UntilSuccessful component to poll http endpoint till condition is met