gpt4 book ai didi

java - 骡子 ESB : How the threads names are managed?

转载 作者:太空宇宙 更新时间:2023-11-04 06:42:32 25 4
gpt4 key购买 nike

下面我发布了使用 Mule ESB 3.4.0 从 websphere 7.0 中提取的 SystemOut.log。我的 Mule 流程是同步流程。它使用“Websphere MQ 消息”并为每条消息记录消息“Message Consume”,然后执行业务操作...

我的问题:

  • 显然不同的线程共享相同的名称,为什么?

  • 长时间没有消息后,Mule 开始每 4 条消息增加线程名称。线程是否泄漏?

日志格式为:

ThreadId [Date] [ThreadName] : Message

ThreadId 来自 websphere,ThreadName 来自 log4j。

SystemOut.log:

00000018 [25-06-2014 10:56:13] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:14] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:15] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:16] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:16] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:16] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:16] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:16] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:17] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000018 [25-06-2014 10:56:18] [DispatchThread: 1]: Message Consume
00000019 [25-06-2014 10:56:19] [DispatchThread: 1]: Message Consume
00000026 [25-06-2014 11:40:46] [DispatchThread: 2]: Message Consume
00000027 [25-06-2014 11:46:15] [DispatchThread: 2]: Message Consume
00000028 [25-06-2014 11:47:23] [DispatchThread: 2]: Message Consume
00000029 [25-06-2014 12:02:12] [DispatchThread: 2]: Message Consume
0000002b [25-06-2014 12:35:21] [DispatchThread: 3]: Message Consume
0000002c [25-06-2014 12:35:21] [DispatchThread: 3]: Message Consume
0000002d [25-06-2014 14:02:04] [DispatchThread: 3]: Message Consume
0000002e [25-06-2014 15:47:56] [DispatchThread: 3]: Message Consume
0000002f [25-06-2014 18:02:30] [DispatchThread: 4]: Message Consume
00000030 [25-06-2014 20:01:59] [DispatchThread: 4]: Message Consume
00000031 [26-06-2014 00:22:48] [DispatchThread: 4]: Message Consume
00000032 [26-06-2014 10:02:05] [DispatchThread: 4]: Message Consume
00000033 [26-06-2014 14:23:23] [DispatchThread: 5]: Message Consume
00000034 [26-06-2014 14:23:23] [DispatchThread: 5]: Message Consume
00000035 [26-06-2014 14:31:29] [DispatchThread: 5]: Message Consume
00000036 [26-06-2014 14:31:29] [DispatchThread: 5]: Message Consume
00000037 [26-06-2014 15:12:53] [DispatchThread: 6]: Message Consume
00000038 [26-06-2014 15:12:54] [DispatchThread: 6]: Message Consume
00000039 [26-06-2014 15:15:19] [DispatchThread: 6]: Message Consume
0000003a [26-06-2014 15:15:20] [DispatchThread: 6]: Message Consume
0000003b [26-06-2014 15:26:12] [DispatchThread: 7]: Message Consume
0000003c [26-06-2014 15:26:12] [DispatchThread: 7]: Message Consume
0000003d [26-06-2014 15:30:50] [DispatchThread: 7]: Message Consume
0000003e [26-06-2014 15:30:51] [DispatchThread: 7]: Message Consume
0000003f [26-06-2014 15:54:43] [DispatchThread: 8]: Message Consume
00000040 [26-06-2014 15:54:43] [DispatchThread: 8]: Message Consume
00000041 [26-06-2014 16:02:21] [DispatchThread: 8]: Message Consume
00000042 [26-06-2014 16:06:21] [DispatchThread: 8]: Message Consume
00000043 [27-06-2014 02:31:18] [DispatchThread: 9]: Message Consume
00000044 [27-06-2014 09:04:16] [DispatchThread: 9]: Message Consume
00000045 [27-06-2014 09:05:36] [DispatchThread: 9]: Message Consume
00000046 [27-06-2014 09:06:38] [DispatchThread: 9]: Message Consume

骡子线程配置:

<configuration doc:name="Configuration">
<default-threading-profile maxBufferSize="300" maxThreadsActive="20" maxThreadsIdle="10" threadTTL="60000" poolExhaustedAction="RUN" />
</configuration>

Mule MQ 配置:

<spring:bean id="connectionFactory" class="com.ibm.mq.jms.MQXAQueueConnectionFactory">
<spring:property name="channel" value="${wmq.channel}" />
<spring:property name="queueManager" value="${wmq.queue.manager}" />
<spring:property name="transportType" value="1" />
<spring:property name="connectionNameList" value="${wmq.host.list}" />
</spring:bean>
<jms:websphere-connector name="wmqConnector" username="${wmq.username}"
password="${wmq.password}" connectionFactory-ref="connectionFactory">
<reconnect-forever blocking="false" frequency="60000" />
</jms:websphere-connector>

注释 1:WebSphere MQ 配置为具有“wmq.host.list”中的两台服务器的高可用性。

注释 2: 连接使用的类是 XA 类。但流程中没有指定交易。

注3:该日志来 self 们的制作,我无法在本地重现。

非常感谢您的帮助。

弗朗索瓦

最佳答案

Mule 使用某些传输的 native 线程池(例如 JMS),而不是创建自己的线程池。

在您的情况下,DispatchThread: x 线程来自 WMQ 客户端。这些线程完全由该客户端管理,即它们是由 WMQ 客户端而不是 Mule 创建、命名和可能销毁的。

这个数字增加并不一定意味着线程泄漏:使用 VisualVM 或 jConsole 来确定线程数是否实际上在增加。

关于java - 骡子 ESB : How the threads names are managed?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24485642/

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