Mule异步抛出handleWorkException

时间:2014-09-26 14:28:14

标签: asynchronous mule

我正在尝试使用来自vm入站端点的异步范围,其交换模式是请求 - 响应。这个想法是从vmmainflow异步调用另外两个流。根据我从mule文档中理解的内容,当vm与请求 - 响应交换模式一起使用时,优先级在调用vm的同一线程上进行。我现在需要从这个vm流中调用另外两个流,它们是单向的,可以异步调用。但是,当我从我的mule-config执行以下操作时,我收到如下所示的错误。这只发生在对服务的并发请求中。我不确定从vm调用异步的方法。如果这种方法有误,请建议我如何解决这个问题。我正在考虑使用另一个带有入站的流作为vm(单向),它实际调用两个流,然后从我的vmmainflow调用新的vm。

<flow name="vmmainflow">
    <vm:inbound-endpoint address="vm://vmmainflow"
            exchange-pattern="request-response" /> 
   ........   
    <async>
      <flow-ref name="flow1" /> 
      <flow-ref name="flow2" /> 
   </async> 
   .....
  </flow>

以下是我得到的错误:

      Exception in thread "null.processor.async.2" org.mule.api.MuleRuntimeException: An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of 'async' child chain' 
[ 
  org.mule.api.processor.LoggerMessageProcessor@ccf1a3, 
  org.mule.api.processor.LoggerMessageProcessor@1fd937a, 
  org.mule.config.spring.factories.FlowRefFactoryBean$1@16a10c1
]" for asynchronously.
org.mule.processor.AsyncInterceptingMessageProcessor handleWorkException] - Work caused exception on 'workCompleted'. Work being executed was: org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker@483ebe
    at org.mule.processor.AsyncInterceptingMessageProcessor.handleWorkException(AsyncInterceptingMessageProcessor.java:197)
    at org.mule.processor.AsyncInterceptingMessageProcessor.workCompleted(AsyncInterceptingMessageProcessor.java:173)
    at org.mule.work.WorkerContext.run(WorkerContext.java:368)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.ConcurrentModificationException
    at org.apache.commons.collections.map.AbstractHashedMap$HashIterator.nextEntry(AbstractHashedMap.java:1113)
    at org.apache.commons.collections.map.AbstractHashedMap$KeySetIterator.next(AbstractHashedMap.java:938)
    at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1010)
    at org.mule.DefaultMuleMessage.copyMessageProperties(DefaultMuleMessage.java:228)
    at org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:203)
    at org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:279)
    at org.mule.DefaultMuleMessage.newThreadCopy(DefaultMuleMessage.java:1375)
    at org.mule.DefaultMuleEvent.newThreadCopy(DefaultMuleEvent.java:713)
    at org.mule.RequestContext.newEvent(RequestContext.java:135)
    at org.mule.RequestContext.setEvent(RequestContext.java:72)
    at org.mule.construct.SimpleFlowConstruct.process(SimpleFlowConstruct.java:125)
    at org.mule.config.spring.factories.FlowRefFactoryBean$1.process(FlowRefFactoryBean.java:40)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:72)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:81)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:122)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:212)
    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)
    at org.mule.work.WorkerContext.run(WorkerContext.java:309)

1 个答案:

答案 0 :(得分:1)

这对我来说似乎是一个真正的错误。我无法想到你可能做错的事情会导致异步消息范围在复制消息属性时抛出ConcurrentModificationException。

也许您的下一步应该是在MuleSoft JIRA中创建一个问题。如果您是MuleSoft企业客户,我建议您在支持门户中创建一个案例..这可以帮助您将问题转移到前端。我建议在两者中链接到这个StackOverflow问题。