【问题标题】:Mule VM Queue thread configurationMule VM Queue线程配置
【发布时间】:2014-09-19 21:40:35
【问题描述】:

我正在尝试了解如何使用 3.5 CE 微调 Mule 中的线程配置文件

流程1

从 FTP 端点获取文件并将其汇集到 VM 队列中。

流程 2

在启用事务的情况下从上述 VM 队列中读取数据并进行一些业务逻辑处理。


我假设 Flow 2 将根据 VM 连接器线程配置在多个线程中执行。但我注意到第二个流程总是使用 4 个线程来并行执行它。已尝试配置默认线程配置文件,它也没有任何区别。请让我知道我错过了什么。任何帮助表示赞赏

VM 连接器配置示例

  <vm:connector name="ITS_VM" validateConnections="true"   >
    <receiver-threading-profile  maxThreadsIdle="30" maxBufferSize="5000" maxThreadsActive="40"/>
    <dispatcher-threading-profile maxThreadsIdle="30" maxBufferSize="5000" maxThreadsActive="40"/>
     <vm:queue-profile  maxOutstandingMessages="500">
         </vm:queue-profile>
    </vm:connector>

默认配置示例

<configuration >
    <default-threading-profile  maxThreadsIdle="30" maxBufferSize="5000" maxThreadsActive="40" />
    <default-dispatcher-threading-profile maxThreadsIdle="30" maxBufferSize="5000" maxThreadsActive="40"/>
    <default-receiver-threading-profile maxThreadsIdle="30" maxBufferSize="5000" maxThreadsActive="40" />
        </configuration>

***控制台日志*****

15:26:13,728 [FetchFiles_Flow.stage1.02] INFO Queued 1 file
15:26:13,797 [ITS_VM.receiver.02] INFO ---------------------------Processing 1 file
15:26:14,114 [FetchFiles_Flow.stage1.03] INFO Queued 1 file
15:26:14,146 [ITS_VM.receiver.03] INFO ---------------------------Processing 1 file
15:26:14,512 [FetchFiles_Flow.stage1.04] INFO Queued 1 file
15:26:14,547 [ITS_VM.receiver.04] INFO--------------------------- Processing 1 file
15:26:14,947 [FetchFiles_Flow.stage1.05] INFO Queued 1 file
15:26:15,000 [ITS_VM.receiver.01] INFO--------------------------- Processing 1 file
15:26:15,349 [FetchFiles_Flow.stage1.06] INFO Queued 1 file
15:26:15,740 [FetchFiles_Flow.stage1.07] INFO Queued 1 file
15:26:16,122 [FetchFiles_Flow.stage1.08] INFO Queued 1 file
15:26:16,510 [FetchFiles_Flow.stage1.09] INFO Queued 1 file
15:26:16,892 [FetchFiles_Flow.stage1.10] INFO Queued 1 file
15:26:17,272 [FetchFiles_Flow.stage1.11] INFO Queued 1 file
15:26:17,646 [FetchFiles_Flow.stage1.12] INFO Queued 1 file
15:26:18,017 [FetchFiles_Flow.stage1.13] INFO Queued 1 file

【问题讨论】:

    标签: mule


    【解决方案1】:

    从 Mule jar 调试源代码后,我发现我还需要设置轮询 VM 队列的消费者数量。

    我通过将 vm:connector 上的 numberOfConcurrentTransactedReceivers 设置为更高的数字来实现此功能。默认值为 4,这就是为什么我只看到 4 个并行线程。

    现在可以正常使用了。希望这对某人有用

    &lt;vm:connector name="ITS_VM" validateConnections="true" createMultipleTransactedReceivers="true" numberOfConcurrentTransactedReceivers="30" >

    可以在此处找到相关帖子 http://ricston.com/blog/mule-jms-consumers-max-threads-active/

    【讨论】:

    【解决方案2】:

    查看文档中的this 页面,您会发现:

    Mule ESB 应用程序是一组流的协作。 从概念上讲,消息由流分三个阶段处理:

    1. 入站连接器正在接收的消息
    2. 正在处理的消息
    3. 通过出站连接器发送的消息

    然后:

    Mule 中的性能调优涉及分析和改进这些 每个流程三个阶段。您可以从应用相同的调优开始 处理所有流程,然后进一步自定义每个流程的调整 根据需要流动。

    您可以阅读计算线程部分,了解如何了解您的需求。

    问候。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 1970-01-01
      • 2018-09-22
      • 2013-12-31
      • 1970-01-01
      • 2014-12-16
      • 1970-01-01
      相关资源
      最近更新 更多