Mule 3异步应答

Mule 3异步应答,mule,Mule,我有一个通过webservice接收请求的流程。我使用组件绑定将该请求转发到JMS队列。但是,我希望从该队列获得异步应答,并将其用作对webservice的响应。我是否需要在流中使用回复到和异步回复路由器?或者在Mule 3中还有其他方法可以做到这一点吗?有什么建议吗 <flow name="mviService"> <http:inbound-endpoint address="http://localhost:62005/mvi" exchange-

我有一个通过webservice接收请求的流程。我使用组件绑定将该请求转发到JMS队列。但是,我希望从该队列获得异步应答,并将其用作对webservice的响应。我是否需要在流中使用回复到和异步回复路由器?或者在Mule 3中还有其他方法可以做到这一点吗?有什么建议吗

<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>
我想我没有很好地描述这个场景。让我再试一次。下面是一个场景--

  • 客户机将此流中描述的服务称为“mviService”。mviService通过基于HTTP/SOAP的入站端点获取XML请求。我们将此请求称为XML121Request.4
  • MVI“com.xyz.services.MVI.MVIServiceImpl”中定义的组件对XML121Request进行了一些更改
  • 将此XML121转发到JMS队列“mviq.121.order”。它为此使用组件绑定
  • 此JMS队列的出站端点是转发此请求的第三方web服务。第三方确认收到XML121和同步web服务调用返回
  • 来自第三方服务的响应会在稍后的时间点出现,通常是几秒钟。响应是异步的。第三方调用MVI上的另一个webservice端点并发送XML1210响应
  • MVI将此响应放入名为“mviq.async.service.reply”的JMS队列中
  • “mviService”流需要等待此响应,并将此响应(经过一些修改)发送给调用者(在步骤1中)
  • 我能够从第三方获得响应,该响应被分配到一个名为“mviq.async.service.reply”的队列中。我想使用/使用此消息,并将其作为对第一次调用MVI的响应返回

    我正在尝试使用“请求-答复”

    
    
    问题是,即使在这种情况下我不希望有出站端点,但我仍然必须放置一个,因为这是请求-应答标记所必需的。流在该时间点等待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
    。你试过我的上述建议了吗?