Mule - 无法为流类型找到StreamCloser:class java.lang.String

时间:2013-04-22 23:18:12

标签: mule

将JMS消息传递到队列后,我看到与Stream Closer相关的日志语句。它看起来不对我..为什么我看到这条消息?

2013-04-22 19:08:29,385 [DEBUG] org.mule.transport.jms.activemq.ActiveMQJmsConnector  - Returning dispatcher for endpoint: jms://retry.queue = EeJmsMessageDispatcher{this=5c5801d7, endpoint=jms://retry.queue, disposed=false}
2013-04-22 19:08:29,433 [DEBUG] org.mule.util.DefaultStreamCloserService  - Unable to find an StreamCloser for the stream type: class java.lang.String, the stream: <?xml version="1.0" encoding="UTF-8"?> < ....... rest of the XML   ....... />  will not be closed.

这是什么意思 - “流:不会被关闭。”?

我该怎么做才能解决这个问题?

====编辑=====

发生错误。 JMS消息将XML作为有效负载。骡子版本:3.3.2

这是我的流程

<flow name="sendToHost">
    <jms:inbound-endpoint queue="host.queue" exchange-pattern="one-way" />
    <copy-properties propertyName="*" />     
    <file:outbound-endpoint path="/hostmessages" outputPattern="outgoing-xml-[function:dateStamp].log" />
    <set-variable variableName="hostXML" value="#[payload]" />
    <flow-ref name="webServiceCall" />
    <flow-ref name="inspectWSResponse" />
    <exception-strategy ref="retryExceptionStrategy" />
</flow>

<flow name="resendFailedMessages">
    <description>   
        "*/15 07-18 * * ?" run every 15 minutes from 7 am to 6 pm every day -->
    </description>
    <quartz:inbound-endpoint jobName="hostRedeliveryJob" cronExpression="0 0/1 * * * ?">
        <quartz:endpoint-polling-job>
            <quartz:job-endpoint ref="redeliverToHost" />
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    <set-variable variableName="hostXML" value="#[payload]" />
    <logger message="QUARTZ found message for host" level="INFO" />
    <flow-ref name="webServiceCall" />
    <flow-ref name="inspectWSResponse" />
    <exception-strategy ref="retryExceptionStrategy" />
</flow>

<choice-exception-strategy name="retryExceptionStrategy">
    <catch-exception-strategy when="#[exception.causedBy(java.io.IOException)]">
        <logger message="In retryExceptionStrategy IO exception strategy. " level="ERROR" />
        <logger message="retryExceptionStrategy exception is #[exception.causeException]" level="ERROR" />
        <set-property propertyName="exception" value="#[exception.summaryMessage]" />
        <set-payload value="#[hostXML]" />
        <logger message="retryExceptionStrategy payload is #[payload]" level="ERROR" />
        <jms:outbound-endpoint queue="retry.queue" />
    </catch-exception-strategy>
    <catch-exception-strategy>
        <logger message="Other error in sending result to host in retryExceptionStrategy flow." level="INFO" />
        <set-property propertyName="exception" value="#[exception.summaryMessage]" />
        <set-payload value="#[hostXML]" />
        <jms:outbound-endpoint queue="declined.queue" />
    </catch-exception-strategy>
</choice-exception-strategy> 

<sub-flow name="webServiceCall">
    <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 address="${host.ws.url}" mimeType="text/xml" connector-ref="http.connector" />
    <byte-array-to-string-transformer />
</sub-flow>

 <sub-flow name="inspectWSResponse">
    <choice>
        <when expression="#[xpath('//acord:TestResult/acord:TestCode/acord:Name/@tc').value == '1']">
            <logger message="Message Delivered Successfully to host" level="INFO" />
        </when>
        <otherwise>
            <set-payload value="#[hostXML]" />
            <jms:outbound-endpoint queue="declined.queue" />
        </otherwise>
    </choice>
</sub-flow>

1 个答案:

答案 0 :(得分:3)

DEBUG级别的日志条目通常可以安全地忽略。

在这种特殊情况下,似乎Mule在消息的有效负载上使用StreamCloserService,而不是流而是字符串。

查看源代码,这似乎只有在处理异常并且Mule尝试强制关闭流式有效负载而不首先检查它是否实际流式传输时才会发生。这是良性的,不会触发任何副作用,因此您可以安全地忽略此DEBUG语句。