Mule ESB : How the threads names are managed?

below I posted an extraction of SystemOut.log from a websphere 7.0 with Mule ESB 3.4.0. My Mule flow is a synchronous one. It consumes "Websphere MQ messages" and log the message "Message Consume" for each message and then do business stuff...

My questions :

  • Clearly different threads shared the same name, why ?

  • After a long period without message, Mule start to increment the thread name each 4 messages. Thread leak or not ?

The log format is :

ThreadId [Date] [ThreadName] : Message

The ThreadId is from websphere and the ThreadName from log4j.

The 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

Mule Thread Configuration :

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

Mule MQ Configuration :

<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>

Note 1 : WebSphere MQ is configured for high availability with two servers in "wmq.host.list".

Note 2 : The class used by the connection is the XA one. But there are no transaction specified in the flow.

Note 3 : The log is from our production, I can not reproduce locally.

Many thanks for your help.

Fran├žois

Answers


Mule uses the native thread pool of some transports, like JMS, instead of creating its own.

In your case, the DispatchThread: x threads are coming from the WMQ client. These threads are fully managed by this client, i.e. they are created, named and possibly destroyed by the WMQ client, not by Mule.

The fact that this number increases doesn't necessary mean thread leak: use VisualVM or jConsole to determine if the number of threads is actually increasing.


Need Your Help

How to build SVN/Git like Diff in WebApp?

java svn git diff compare

I have XMLs(or Objects) that represents data at some point in a business process. I would like to be able to see what has changed between step1 and step5(two versions of the same XML or Object). Id...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.