Re: Are any parts of JMS non-thread-safe, thus not reusable across threads?

Doug Bateman <[email protected]> Sun, 15 Feb 2004 15:31:53 -0700
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <LISTSERV%[email protected]>
>Are any parts of JMS not thread-safe, thus not concurrently reusable
>across threads?  There are several pieces, being the ConnectionFactory,
>Connection, Session, Sender, and Message.  I'm not concerned about the
>Message object itself, as I don't expect that to be reused, but I am
>concerned about the other objects.

The following applies for both topics and queues:
ThreadSafe: Connection, ConnectionFactory, Destination
Non-ThreadSafe: Session, MessageConsumer, MessageProducer, MessageListener

Basically, anything associated with the session is single threaded.
Anything else is threadsafe.

Doug

P.S.  Try reading a good book on JMS.  It should answer questions like
these.

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".