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

标签 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>

最佳答案

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

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

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

关于Mule - 无法找到流类型 : class java. lang.String 的 StreamCloser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16158311/

相关文章:

java - Mule MUnit FTP 服务器架构定义

variables - 如何检查 Mule MEL 中是否存在 session 变量?

java - 如何使用属性禁用 Mule 的 IMAP 入站端点

mule - 为 APIKit 的 Mulesoft 中的 MUnit 流引用设置入站属性

java - 如何使用 MULE ESB 将邮件附件传递给 POJO 对象

java - 如何使用 mule esb 将 map 存储在磁盘上?

java - 如何检查 mule 中的入站 header "content-type"响应?

java - Mule中如何动态插入json数据到数据库中

java - 您可以从 MuleESB <choice> 调用 bean 中的方法吗?

java - 单元测试不适用于 XSLT 变压器