Mule 响应阶段什么时候会被忽略?
When will Mule response phase get ignored?
我正在阅读 Mule in Action 一书以了解 response phase
。作者说:
Finally, the last thing to consider is that the outcome of the response phase is
ignored if the flow response is returned via reply-to routing.
不是很懂。任何人都可以让我理解它吗?提前致谢。
这是一个例子。这里 request-reply 路由器将添加一个 replyTo header,因此流 'replyto' 的结果被发送回 'replytoout' queue。它将到达请求阶段的末尾,然后 return 结果而不调用响应阶段。
如果你运行这你应该看到以下记录:
Final value::: B
而不是 'C',因为忽略了响应阶段
<flow name="replytotest">
<poll frequency="60000">
<logger level="INFO" message="Starting" />
</poll>
<set-payload value="A" />
<request-reply>
<vm:outbound-endpoint address="vm://replytoin" />
<vm:inbound-endpoint address="vm://replytoout" />
</request-reply>
<logger level="INFO" message="Final value::: #[payload] " />
</flow>
<flow name="replyto">
<vm:inbound-endpoint address="vm://replytoin" />
<set-payload value="B" />
<response>
<set-payload value="C" />
</response>
</flow>
我正在阅读 Mule in Action 一书以了解 response phase
。作者说:
Finally, the last thing to consider is that the outcome of the response phase is
ignored if the flow response is returned via reply-to routing.
不是很懂。任何人都可以让我理解它吗?提前致谢。
这是一个例子。这里 request-reply 路由器将添加一个 replyTo header,因此流 'replyto' 的结果被发送回 'replytoout' queue。它将到达请求阶段的末尾,然后 return 结果而不调用响应阶段。
如果你运行这你应该看到以下记录:
Final value::: B
而不是 'C',因为忽略了响应阶段
<flow name="replytotest">
<poll frequency="60000">
<logger level="INFO" message="Starting" />
</poll>
<set-payload value="A" />
<request-reply>
<vm:outbound-endpoint address="vm://replytoin" />
<vm:inbound-endpoint address="vm://replytoout" />
</request-reply>
<logger level="INFO" message="Final value::: #[payload] " />
</flow>
<flow name="replyto">
<vm:inbound-endpoint address="vm://replytoin" />
<set-payload value="B" />
<response>
<set-payload value="C" />
</response>
</flow>