Mule VM Queue线程配置

Joe*_*ria 1 mule

在此处输入图片说明

我试图了解如何使用 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>
Run Code Online (Sandbox Code Playgroud)

示例默认配置

<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>
Run Code Online (Sandbox Code Playgroud)

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

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
Run Code Online (Sandbox Code Playgroud)

Joe*_*ria 5

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

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

它现在工作正常。希望这对某人有用

<vm:connector name="ITS_VM" validateConnections="true" createMultipleTransactedReceivers="true" numberOfConcurrentTransactedReceivers="30" >

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