在调用外部供应商 Web 服务时,我正在模拟超时异常(或任何其他异常)。我在流程开始时存储原始有效负载,并在捕获异常策略中,将有效负载替换为原始有效负载。有效负载被替换得很好,应用 XSLT 转换器很好,将转换后的有效负载复制到文件出站很好,但奇怪的是 JMS 得到空消息(尽管消息属性是完整的)。使用Mule 3.3.1
和ActiveMQ
。如果 Active MQ 替换为Sonic
<flow name="orderRequirementsToVendor">
<jms:inbound-endpoint queue="order.vendor" />
<set-variable variableName="originalPayload" value="#[message.payload]" />
<outbound-endpoint address="${vendor.ws.url}" mimeType="text/xml" connector-ref="https.connector" responseTimeout="100">
<cxf:proxy-client payload="body" enableMuleSoapHeaders="false">
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
</cxf:inInterceptors>
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
</cxf:outInterceptors>
</cxf:proxy-client>
</outbound-endpoint>
.
.
.
<choice-exception-strategy>
<catch-exception-strategy>
<logger message="In catch exception strategy. Unknown Exception" level="ERROR" />
<logger message="#[exception.causeException]" level="ERROR" />
<set-payload value="#[flowVars.originalPayload]"/>
<set-property propertyName="exception" value="#[exception.summaryMessage]"/>
<transformer ref="generalErrorTransformer" />
<file:outbound-endpoint path="/outbound/vendor/error/ack-before" outputPattern="out_vendor_transformed_ack_error_beforeStatusQueue[function:dateStamp].xml" />
<jms:outbound-endpoint queue="order.status" />
<file:outbound-endpoint path="/outbound/vendor/error/ack-after" outputPattern="out_vendor_transformed_ack_error_afterStatusQueue[function:dateStamp].xml" />
</catch-exception-strategy>
</choice-exception-strategy>
</flow>
两者都ack-before
包含ack-after
正确有效负载的文件,但在 order.status 中收到的消息为空
编辑: 这是我的日志中的例外
2013-05-29 09:12:33,864 ERROR [orderRequirementsToVendor.stage1.02] exception.AbstractExceptionListener (AbstractExceptionListener.java:299) -
********************************************************************************
Message : COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod
Code : MULE_ERROR-42999
--------------------------------------------------------------------------------
Exception stack is:
1. Read timed out (java.net.SocketTimeoutException)
java.net.SocketInputStream:-2 (null)
2. Read timed out (com.ctc.wstx.exc.WstxIOException)
com.ctc.wstx.sw.BaseNsStreamWriter:617 (null)
3. COULD_NOT_READ_XML_STREAM (org.apache.cxf.interceptor.Fault)
org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter:133 (null)
4. COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
org.mule.module.cxf.CxfOutboundMessageProcessor:144 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************