Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Multithreading 组件未从接收器拾取消息(线程问题?)_Multithreading_Mule - Fatal编程技术网

Multithreading 组件未从接收器拾取消息(线程问题?)

Multithreading 组件未从接收器拾取消息(线程问题?),multithreading,mule,Multithreading,Mule,当从JMS队列Websphere MQ提取消息以便使用Mule v进行进一步处理时,我们会遇到错误。2.2.1. 下面我已经包括了受影响的服务以及Mule日志的摘录。第一段(DispatchThread:1)是服务按预期工作时的情况,第二段(DispatchThread:6)是消息丢失即未处理 如日志所示,在这两种情况下,消息都作为事件排队等待processFooBar.service处理,但在后一种情况下,消息永远不会被拾取以进行进一步处理。在工作示例中,它几乎立即被解列和处理 我们怀疑这是由

当从JMS队列Websphere MQ提取消息以便使用Mule v进行进一步处理时,我们会遇到错误。2.2.1. 下面我已经包括了受影响的服务以及Mule日志的摘录。第一段(DispatchThread:1)是服务按预期工作时的情况,第二段(DispatchThread:6)是消息丢失即未处理

如日志所示,在这两种情况下,消息都作为事件排队等待processFooBar.service处理,但在后一种情况下,消息永远不会被拾取以进行进一步处理。在工作示例中,它几乎立即被解列和处理

我们怀疑这是由线程配置文件(即接收器线程配置文件等)中的不平衡造成的,但同时我们认为这是一个相当模糊的解释。有点令人担忧的是,消息可能会在没有跟踪的情况下丢失,即使我们增加了线程数量,如果系统负载增加,我们也可能会遇到同样的问题

如果我们的怀疑能够得到证实,如果有人遇到同样的问题,我将不胜感激,他们对此做了什么?我们将升级到Mule 3,但我怀疑这个问题对Mule 3没有什么不同

服务定义:

<service name="processFooBar">
    <inbound>
        <jms:inbound-endpoint queue="A.FROM.BAR"
                              connector-ref="fooConnector"
                              disableTemporaryReplyToDestinations="true">
            <transformers>
                <transformer ref="messageLogger"/>
                <transformer ref="jmsMessageToObjectTransformer"/>
                ...
                ..
            </transformers>
        </jms:inbound-endpoint>
    </inbound>
    ...
    ..
</service>

Mule将最大线程默认值限制为16,因此您可以继续更改:

你能做的第一件事

在JMS连接器上设置numberOfConsumers属性 在JMS连接器的接收器线程配置文件元素上设置MaxThreadsActivity属性 另一个解决方案是您可以设置流程处理策略,请参考以下链接:

...
..
@ESB-: 2013-06-24 10:31:37,319 DEBUG [DispatchThread: 1] org.mule.service.AbstractService - Service: processFooBar has received asynchronous event on: jms://A.FROM.BAR
@ESB-: 2013-06-24 10:31:37,319 DEBUG [DispatchThread: 1] org.mule.model.seda.SedaService - Service: processFooBar has received asynchronous event on: jms://A.FROM.BAR
@ESB-: 2013-06-24 10:31:37,319 DEBUG [DispatchThread: 1] org.mule.model.seda.SedaService - Service processFooBar putting event on queue processFooBar.service: MuleEvent: ..., endpointEncoding=UTF-8}
@ESB-: 2013-06-24 10:31:37,321 DEBUG [processFooBar.1] org.mule.model.seda.SedaService - Service: processFooBar dequeued event on: jms://A.FROM.BAR
@ESB-: 2013-06-24 10:31:37,331 DEBUG [processFooBar.1] org.mule.model.seda.SedaService - Service processFooBar polling queue processFooBar.service, timeout = 10,000
@ESB-: 2013-06-24 10:31:37,339 DEBUG [processFooBar.2] org.mule.DefaultMuleMessage - new copy of message for Thread[processFooBar.2,5,main]
@ESB-: 2013-06-24 10:31:37,367 DEBUG [processFooBar.2] org.mule.transformer.AbstractTransformer - Setting transformer name to: fooDecoderTransformer
@ESB-: 2013-06-24 10:31:37,368 DEBUG [processFooBar.2] org.mule.transformer.AbstractTransformer - java.lang.Object has been added as source type for this transformer, there will be no source type checking performed
@ESB-: 2013-06-24 10:31:37,368 DEBUG [processFooBar.2] org.mule.transformer.AbstractTransformer - Setting transformer name to: objectToStringTransformer
...
..
@ESB-: 2013-06-24 13:19:51,896 DEBUG [DispatchThread: 6] org.mule.service.AbstractService - Service: processFooBar has received asynchronous event on: jms://FOMS.FROM.FSM.Bar
@ESB-: 2013-06-24 13:19:51,896 DEBUG [DispatchThread: 6] org.mule.model.seda.SedaService - Service: processFooBar has received asynchronous event on: jms://FOMS.FROM.FSM.Bar
@ESB-: 2013-06-24 13:19:51,897 DEBUG [DispatchThread: 6] org.mule.model.seda.SedaService - Service processFooBar putting event on queue processFooBar.service: MuleEvent: ..., endpointEncoding=UTF-8}
...
..
<jms:activemq-connector name="jmsConnector" numberOfConsumers="15" brokerURL="vm://localhost">
    <receiver-threading-profile maxThreadsActive="15"/>
</jms:activemq-connector>