当所有组件之后的有效负载是CopyOnWriteArrayList <object>类型时,如何获取所需的数据?

时间:2015-05-11 09:16:08

标签: mule mule-studio mule-component

目前我正在研究Mule 3.4.2 EE。我对Mule All coponent有一个疑问。在所有块中iam调用两个流引用来获取数据,并且在mule之后所有组件都是CopyOnWriteArrayList<Object>类型如何获取数据?提前谢谢。

<sub-flow name="Aggregating_Flow" doc:name="Aggregating_Flow">
        <logger level="INFO" doc:name="Logger"/>
        <all doc:name="All">
            <flow-ref name="PHYBMDATAReportingDataFetchFlow" doc:name="PHYBMDATAReportingDataFetchFlow"/>
            <flow-ref name="PHYBMDATABOALFReportingDataFetchFlow" doc:name="PHYBMDATABOALFReportingDataFetchFlow"/>
        </all>
        <logger level="INFO" doc:name="Logger" message="paaaaaayload is #[payload:]"/>
        <component class="com.xxx.bmrs.api.util.PrepareBMRSPHYBMDATAXMLResponse" doc:name="PrepareBMRSPHYBMDATAXMLResponse"/>
        <logger  level="INFO" doc:name="Logger"/>
    </sub-flow>

在使用java组件的所有组件之后。如何获得数据我得到以下异常..

********************************************************************************
Message               : Payload was invalidated calling setPayload and the message is not collection anymore. (java.lang.IllegalStateException). Message payload is of type: PHYBMDATARequest
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Payload was invalidated calling setPayload and the message is not collection anymore. (java.lang.IllegalStateException)
  org.mule.DefaultMessageCollection:104 (null)
2. Payload was invalidated calling setPayload and the message is not collection anymore. (java.lang.IllegalStateException). Message payload is of type: PHYBMDATARequest (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalStateException: Payload was invalidated calling setPayload and the message is not collection anymore.
    at org.mule.DefaultMessageCollection.checkValidPayload(DefaultMessageCollection.java:104)
    at org.mule.DefaultMessageCollection.newThreadCopy(DefaultMessageCollection.java:309)
    at org.mule.DefaultMuleEvent.newThreadCopy(DefaultMuleEvent.java:799)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

1 个答案:

答案 0 :(得分:0)

请在此处查看此错误:https://www.mulesoft.org/jira/browse/MULE-6795

您可以在所有路由器之后添加combine-collections-transformer

或者,如果可以,请更好地将all路由器更改为scatter-gatherhttp://www.mulesoft.org/documentation/display/current/Scatter-Gather