gpt4 book ai didi

Mule VM 队列线程配置

转载 作者:行者123 更新时间:2023-12-02 21:23:54 27 4
gpt4 key购买 nike

enter image description here

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

流程1

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

流程 2

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


我假设流程 2 将根据 VM 连接器线程配置在多个线程中执行。但我注意到第二个流程始终使用 4 个线程来并行执行。已尝试配置默认线程配置文件,它也没有任何区别。请让我知道我缺少什么。感谢任何帮助

虚拟机连接器配置示例

  <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 jar 的源代码后,我发现我还需要设置轮询 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/

关于Mule VM 队列线程配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25923490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com