Mule异步请求-应答
实际上,我通过8081端口上的http请求,使用Mule异步请求-应答,mule,esb,mule-studio,Mule,Esb,Mule Studio,实际上,我通过8081端口上的http请求,使用表达式组件调用exe。exe在端口8082上发送http请求,我可以记录输出。 最后,我必须将回复流的输出发送回主流,但我不知道如何 这是我的密码: <flow name="mainFlow" doc:name="mainFlow"> <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081" doc:
表达式组件调用exe
。exe
在端口8082上发送http请求,我可以记录输出。
最后,我必须将回复流的输出发送回主流,但我不知道如何
这是我的密码:
<flow name="mainFlow" doc:name="mainFlow">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081" doc:name="HTTP" />
<request-reply timeout="10000">
<vm:outbound-endpoint path="request" exchange-pattern="one-way"/>
<vm:inbound-endpoint path="reply" exchange-pattern="one-way"/>
</request-reply>
</flow>
<flow name="request" doc:name="request">
<vm:inbound-endpoint path="request" doc:name="VM" />
<expression-component doc:name="Expression">Runtime.getRuntime().exec("C:\\myfile.exe arg1");</expression-component>
</flow>
<flow name="reply" doc:name="reply">
<http:inbound-endpoint address="http://localhost:8082" doc:name="HTTP" exchange-pattern="one-way" />
<logger message="#[message.inboundProperties['test']]" level="INFO" doc:name="Logger"/>
<vm:outbound-endpoint path="reply" doc:name="VM" exchange-pattern="one-way"/>
</flow>
Runtime.getRuntime().exec(“C:\\myfile.exe arg1”);
您必须确保通过exe
下至http://localhost:8082
否则,请求-回复
消息处理器无法将异步回复与当前请求关联起来
例如,将关联ID的第二个参数传递给exe
:
<expression-component doc:name="Expression">
Runtime.getRuntime().exec("C:\\myfile.exe arg1 " + message.correlationId);
</expression-component>
Runtime.getRuntime().exec(“C:\\myfile.exe arg1”+message.correlationId);
并确保exe
向http://localhost:8082
在一个名为X-MULE\u CORRELATION\u ID
的HTTP头中,我认为您还必须从出站请求中删除MULE\u REPLYTO属性:这一点很好。是的,可能,这取决于表达式组件如何/如果影响回复机制。我想知道您是否需要
,您可以将MULE\u REPLYTO和设置为入站队列名称,它应该可以工作。。。我也在这里学习,在某种程度上试图澄清我的理解