Announcement Announcement Module
Collapse
No announcement yet.
Is JmsTemplate102 Thread Safe Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is JmsTemplate102 Thread Safe

    Hi

    Can i have a JmsTemplate102 instance variable that is used in a servlet... Or to say it another way is JmsTemplate102 thread safe like a datasource.

    or should i do:

    jt = new JmsTemplate102(connFactory, false);
    jt.send(queue, new MessageCreator() {
    public Message createMessage(Session session) throws JMSException {
    return session.createTextMessage("hello queue world");
    }
    });

    each time my service method is called.

  • #2
    JmsTemplate102, like all of Spring's "template" classes, should be perfectly thread-safe. Hence, I recommend to hold it in instance variables.

    Juergen

    Comment


    • #3
      Many thanks

      Hi Juergen

      Many thanks... i was hoping it worked just like the JDBCTemplate. Any plans to make the docs in spring a wiki... So that the community can add extra helpful info ?

      Comment

      Working...
      X