I'm using one thread which i set a name "LegacyMsgConsumer-Main-Thread" to get messages from a MsgQueue , and then put those inside a ThreadPoolExecutor
to handle. this service works ok the at the beginning(I can see from the mornitor showing that is consuming messages), but after several hourse, the monitor showing the message consumed is 0. I've dumped the thread two ways : jstack and jmap . i've check both thread dump :
Those
Legacy-Consumer-Pool
is the ThreadPoolExecutor that handle messages, there're waiting for message to handle, but i can't find the thread that getting message from MessageQueue(which i named LegacyMsgConsumer-Main-Thread
). here is my code .
set a name to the message getting thread.
getting message from a messageQueue , this runs in a while loop
count the number of empty message
sleep the thread , sleep time is based on the count of empty message.
submit valid message to the
ThreadPoolExecutor
to handle.
my question is :
where is the LegacyMsgConsumer-Main-Thread
thread ? Did it being Garbage Collected ?