In JmsSpout.javajavax.jms.Session instance is used by multiple threads what is errornous according to Javadoc:
Once a connection has been started, any session with one or more registered message listeners is dedicated to the thread of control that delivers messages to it. It is erroneous for client code to use this session or any of its constituent objects from another thread of control. The only exception to this rule is the use of the session or message consumer close method.
The close method is the only session method that can be called while some other session method is being executed in another thread.
In JmsSpout.java message listener is registered (line 179), so the Session instance is dedicated to the thread delivering messages. At the same time scheduled executor periodically runs RecoveryTask calling recover() method on the same Session instance in new thread (line 356).
According to Javadoc this is erroneous usage of Session.
In JmsSpout.java
javax.jms.Session
instance is used by multiple threads what is errornous according to Javadoc:In JmsSpout.java message listener is registered (line 179), so the
Session
instance is dedicated to the thread delivering messages. At the same time scheduled executor periodically runsRecoveryTask
callingrecover()
method on the sameSession
instance in new thread (line 356).According to Javadoc this is erroneous usage of
Session
.