Are messages thread-safe?
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:
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.
Note that clients can use multiple sessions to partition client operations. For example, one client thread can drive one session and another client thread can drive another session. Each session object serializes execution of message listeners (the methods that handle asynchronously delivered messages). Thus, message listeners (handlers) can share session-related resources. Client resources (critical objects) outside the session, however, are the responsibility of the application designer, as always.