Are messages thread-safe?
Location: http://www.jguru.com/faq/view.jsp?EID=1120 Created: Nov 17, 1999 Modified: 1999-12-01 14:58:10.967 Author: Jerry Smith (http://www.jguru.com/guru/viewbio.jsp?EID=9) If the JMS specification required a thread-safe implementation for all objects, it would, in many situations, be a burden on programmers. The following objects support concurrent use: • Destination • ConnectionFactory • Connection Session, on the other hand, is a single-threaded context that handles message-passing operations. A session serves as a message factory and it processes messages in serial order. One reason for the single-thread design is that a session is responsible for transaction-related operations. Sessions are single-threaded contexts because a session is where the action is. In particular, a session is responsible for operations such as transaction handling and asynchronous message passing. Requiring client code that’s related to asynchronous message reception to support concurrent use would have