【问题标题】:Mule - Unable to find an StreamCloser for the stream type: class java.lang.StringMule - 找不到流类型的 StreamCloser:类 java.lang.String
【发布时间】:2013-04-23 08:16:30
【问题描述】:

在 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>

【问题讨论】:

    标签: mule


    【解决方案1】:

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

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

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

    【讨论】:

    • 大卫...感谢您的关注。我已经更新了问题。
    • 我认为这是javax.jmx.TextMessage(您没有指定)。既然你有一个错误,那么这个DEBUG 消息是预期的。我相应地更新了我的答案。
    猜你喜欢
    • 2019-07-27
    • 2013-09-12
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 2012-08-23
    • 1970-01-01
    • 2016-09-16
    相关资源
    最近更新 更多