骡子奇怪的流动行为

时间:2012-12-14 20:58:46

标签: mule

我正在使用mule 3.2.0和 我在java-class中调用muleclient.send方法,它将soap-request发送到mule流(此处不存在),将其发送到接收请求的http端点,使用代理模式将其记录到我的数据库并将其传播到“ServiceFlow”,它具有Dispatcher转换器 - java类,它使用MuleClient.send(String url,Object payload,Map messageProperties)方法的调用将有效负载数组的一个对象分派给端点。 然后它由cxf:jax-ws-client处理,再次登录到db并转移到另一个Dispatcher实例(其中传入的有效负载的类型为Object [])。我有http端点进行服务调用。这部分工作正常。 但是在收到回复时会出现麻烦。我已经把Test1(2,3,4)变换器打印到我的流中的调用链(它们只是执行System.out.println()),并看到它们以一个奇怪的顺序被调用:我有它像1,3然后TestTransformer(也是sysouter)然后我在主流“服务流程”的调用者中得到错误“NullPayload”,然后我收到测试4和测试2出局。忽略模式“1Proxy”中的responseTransformer-refs,如“ServiceProxy”中所示。我一直在寻找一周的解决方案,但找不到它。在调试中,我可以看到名为“TestTransformer”的变换器具有预期的有效载荷(Object []),但是当我在类调用者中收到它时,它显示为“NullPayload”。我现在可以看到我的一个端点有路径元素而不是ref,不确定这是否会对流产生任何影响,但会检查它。还尝试使用“响应”块来确保我的流程按预期运行。任何建议赞赏。感谢

以下是我的配置:

<http:endpoint  name="httpService"  address="${service.soap}" exchange-pattern="request-response" responseTimeout="${timeout}" />
<vm:endpoint  name="vmService"  path="vmService" exchange-pattern="request-response"/>

<pattern:web-service-proxy 
    name="ServiceProxy" 
    inboundEndpoint-ref="httpService" 
    transformer-refs="to-string logging" 
    responseTransformer-refs="to-string logging"
    outboundEndpoint-ref="vmService" />

<flow name="ServiceFlow" >
    <inbound-endpoint ref="vmService"/>
    <cxf:jaxws-service serviceClass="pkg.ServiceImpl" wsdlLocation="${service.wsdl}" enableMuleSoapHeaders="false" validationEnabled="true"/>
  <custom-transformer class="pkg.Dispatcher">
     <spring:property name="vmFlowPath" value="vm.logService"/>
  </custom-transformer>
  <custom-transformer name="TestTransformer" class="pkg.TestTransformer"/>
</flow>

<vm:endpoint  name="vm1In"  path="vm1In" exchange-pattern="request-response"/>
<vm:endpoint  name="vm1Out"  path="vm1Out" exchange-pattern="request-response"/>

<custom-transformer name="arrayGenerator" class="pkg.ArrayGenerator"/>
<custom-transformer name="objectExtractor" class="pkg.ObjectExtractor"/>
<custom-transformer name="faultChecker" class="pkg.FaultChecker"/>  
<custom-transformer name="objectLogging" class="pkg.ObjectLogger">

<pattern:web-service-proxy 
    name="1Proxy" 
    inboundEndpoint-ref="vm1In" 
    transformer-refs="arrayGenerator objectLogging" 
    responseTransformer-refs="objectLogging objectExtractor faultChecker"
    outboundEndpoint-ref="vm1Out" />

<flow name="logService">

<vm:inbound-endpoint path="vm.logService exchange-pattern="request-response"/>

<custom-transformer class="Test1"/>

<vm:outbound-endpoint ref="vm1In">
    <cxf:jaxws-client 
        serviceClass="pkg.ServiceImpl" 
        operation="import"
        enableMuleSoapHeaders="false"/>
    <object-to-string-transformer/>

</vm:outbound-endpoint>
<object-to-xml-transformer> 

<xm:xml-to-object-transformer returnClass="pkg.WSResponseClass"/>

<custom-transformer class="Test2"/>
</flow>

<flow name="DispatcherToServiceFlow">
    <custom-transformer class="Test3"/>
    <vm:inbound-endpoint path="vm1.Out"/>

    <custom-transformer class="pkg.Dispatcher">
        <spring:property name="vmFlowPath" value="vm.import"/>
    </custom-transformer>

</flow> 

<flow name="import">
    <vm:inbound-endpoint path="vm.import" exchange-pattern="request-response"/>

    <http:outbound-endpoint address="${importService}" responseTimeout="${timeout}" exchange-pattern="request-response" />

    <object-to-string-transformer/>
<custom-transformer class="Test4"/>
</flow>

1 个答案:

答案 0 :(得分:1)

好吧,我的问题确实是“path”元素,而不是引用现有的带有“ref”元素的vm端点,如

<inbound-endpoint ref="vm1Out"/>