activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From itelleria <telle...@gmail.com>
Subject ActimeMQ Client's thread management
Date Wed, 13 Jan 2016 08:30:49 GMT
Hi,

I'm analysing how ActiveMQ client manages the threads to send and receive
JMS messages and I have some questions that I would like to ask.

As far as I've understood when I call connectionFactory.createConnection(),
I get a Connection object which launches a Transport thread in the
background as well as other threads to monitor inactivity. Monitoring with
JConsole I can see these ActiveMQ threads running in the client:

<http://activemq.2283324.n4.nabble.com/file/n4705885/Screen_Shot_2016-01-13_at_08.png>


Setting the useInactivityMonitor property to false, I can disable the
inactivity threads. However, apparently I can’t disable Transport thread.
Therefore, every time a Connection object is created a Transport thread is
launched?

I've seen that Transport threads reads different types of commands from the
socket connected to the broker (keepalive, wirecommand, messagedispatch,
etc) and when a MessageDispatch command is received, it executes the
corresponding MessageListener. So, for asynchronous message delivery I can
understand why the transport thread is created.

However, I think there are some cases when this thread is not needed. For
example, when I send a message I haven't seen that the Transport thread is
used. So, if I open connection only to send a Message, why the Transport
thread is created? I guess that the thread, which has invoked the send()
method, sends the message to the broker without using the transport thread. 

Thanks in advance,

Iñigo





--
View this message in context: http://activemq.2283324.n4.nabble.com/ActimeMQ-Client-s-thread-management-tp4705885.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message