We are using Apache Qpid JMS Client(0.45) to consume messages from ServiceBus. We are getting Suspected deadlocked threads while restarting of connection. After log investigation, we realized that JmsSession was not closed properly. While closing JmsSession - we received Illegal invocation from MessageListener callback error. It could be a reason for thread blocking.
If we received an exception while closing JMS Connection/Session/Consumer, then how can we close and clean up properly from system?
I reset JMS object after closing such as Connection = null, MessageConsumer=null; Session = null;
.
I think this is not working properly as some Threads are still open in System.
Could anyone please suggest any idea to clean and close JMS object properly from System?
Sample deadlock log
Suspected deadlocked threads: JmsSession [ID:7086e194-aaec-4b41-cde1-fd680526e07a:1:12] delivery dispatcher Id=201 is in WAITING on lock=java.util.concurrent.locks.ReentrantLock$NonfairSync@20af281a
is owned by JmsSession [ID:7086e194-aaec-4b41-cde1-fd680526e07a:1:10] delivery dispatcher Id=199 | JmsSession [ID:7086e194-aaec-4b41-cde1-fd680526e07a:1:10] delivery dispatcher Id=199 is in BLOCKED on lock=org.mule.transport.Servicebus@778245e1
is owned by JmsSession [ID:7086e194-aaec-4b41-cde1-fd680526e07a:1:12] delivery dispatcher Id=201 | "