Mule 3异步应答
我有一个通过webservice接收请求的流程。我使用组件绑定将该请求转发到JMS队列。但是,我希望从该队列获得异步应答,并将其用作对webservice的响应。我是否需要在流中使用回复到和异步回复路由器?或者在Mule 3中还有其他方法可以做到这一点吗?有什么建议吗Mule 3异步应答,mule,Mule,我有一个通过webservice接收请求的流程。我使用组件绑定将该请求转发到JMS队列。但是,我希望从该队列获得异步应答,并将其用作对webservice的响应。我是否需要在流中使用回复到和异步回复路由器?或者在Mule 3中还有其他方法可以做到这一点吗?有什么建议吗 <flow name="mviService"> <http:inbound-endpoint address="http://localhost:62005/mvi" exchange-
<flow name="mviService">
<http:inbound-endpoint address="http://localhost:62005/mvi"
exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.xyz.services.mvi.MVIServicePortType" />
</http:inbound-endpoint>
<component class="com.pennmutual.services.mvi.MVIServiceImpl">
<binding interface="com.pennmutual.mvi.helper.XMLReqProcessorInterface"
method="process121Order">
<jms:outbound-endpoint queue="mviq.121.order" />
</binding>
</component>
<async-reply>
</async-reply>
</flow>
============已编辑-请参阅下面重新编排的问题=================
<flow name="mviService">
<http:inbound-endpoint address="http://localhost:62005/mvi"
exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.xyz.services.mvi.MVIServicePortType" />
</http:inbound-endpoint>
<component class="com.xyz.services.mvi.MVIServiceImpl">
<binding interface="com.xyz.mvi.helper.XMLReqProcessorInterface"
method="process121Order">
<jms:outbound-endpoint queue="mviq.121.order" exchange-pattern="request-response">
<message-properties-transformer scope="outbound">
<add-message-property key="MULE_REPLYTO" value="mviq.async.service.reply" />
</message-properties-transformer>
</jms:outbound-endpoint>
</binding>
</component>
</flow>
我想我没有很好地描述这个场景。让我再试一次。下面是一个场景--
问题是,即使在这种情况下我不希望有出站端点,但我仍然必须放置一个,因为这是请求-应答标记所必需的。流在该时间点等待60秒,但即使我将某些内容放入队列“mviq.async.service.reply”中,相关ID也不匹配,因此服务超时并返回错误
流量如下所述
<flow name="mviService">
<http:inbound-endpoint address="http://localhost:62005/mvi"
exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.xyz.services.mvi.MVIServicePortType" />
</http:inbound-endpoint>
<component class="com.pennmutual.services.mvi.MVIServiceImpl">
<binding interface="com.xyz.mvi.helper.XMLReqProcessorInterface"
method="process121Order">
<jms:outbound-endpoint queue="mviq.121.order" />
</binding>
</component>
<!-- <logger message="XML Correlation ID 1 is #[mule:message.headers(all)]" /> -->
<request-reply timeout="60000">
<vm:outbound-endpoint path="request" /> <!-- we don't care about this -->
<jms:inbound-endpoint queue="mviq.async.service.reply"
exchange-pattern="one-way" />
</request-reply>
<!-- <component class="com.xyz.mvi.CreateMVIServiceResponse"/> -->
</flow>
====带有回复的流程=============
<flow name="mviService">
<http:inbound-endpoint address="http://localhost:62005/mvi"
exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.xyz.services.mvi.MVIServicePortType" />
</http:inbound-endpoint>
<component class="com.xyz.services.mvi.MVIServiceImpl">
<binding interface="com.xyz.mvi.helper.XMLReqProcessorInterface"
method="process121Order">
<jms:outbound-endpoint queue="mviq.121.order" exchange-pattern="request-response">
<message-properties-transformer scope="outbound">
<add-message-property key="MULE_REPLYTO" value="mviq.async.service.reply" />
</message-properties-transformer>
</jms:outbound-endpoint>
</binding>
</component>
</flow>
我建议您不要创建服务组件类,而是使用
cxf:proxy service
,这将使您能够直接访问SOAP信封,并有机会以您想要的方式在XML级别组装响应
这将使您摆脱服务组件类对您施加的约束,因此无需使用绑定,并打开了使用请求-响应的大门
有关更多信息,请参阅并检查(skinny)。如果指定请求-响应
作为jms:outbound端点的交换模式
,该怎么办?你不是这样得到一个同步响应吗?问题是流必须是单向的。原因是jms:outbound端点流调用一个web服务,来自该web服务的响应在稍后的时间点(几秒钟内)通过另一个名为“mviq.async.service.reply”的jms队列异步到达。我想在上面提到的流“mviService”中收听这个jms队列“mviq.async.service.reply”。如果您将JMSReplyTo
出站属性设置为mviq.async.service.reply
在jms:outbound endpoint
之前(配置为请求-响应
),该怎么办。或者,将MULE\u REPLYTO
outbound属性设置为jms://mviq.async.service.reply
.David,我试图重新定义问题的框架。如果您能在此基础上给我一些反馈,我将不胜感激。您不能在您的场景中使用request-reply
。你试过我的上述建议了吗?