For optimized sending, you should use the
JmsSenderTemplate classes (in package
com.atomikos.jms.extra): these classes take care of reusing connections/sessions, cleaning up and closing sessions when needed, and refreshing connections.
For optimized receiving, you should use the
com.atomikos.jms.extra.MessageDrivenContainer class: it will take care of reusing connections/sessions, cleaning up and closing sessions when needed, and refreshing connections. This class also detects incoming messages
immediately and does not use a polling approach (like many other products do).