5 Replies Latest reply on Jul 22, 2008 12:55 AM by Tim Fox

    Spring JmsTemplate questions

    Mr. Overlord Newbie

      First I'll describe my configuration.

      I'm sending a message from a JBoss AS to a remote queue on another JBoss AS using Spring's infamous JmsTemplate to send the message.

      I read the advice concerning the use of Spring's JmsTemplate but I inherited this code so i'm hesitant to remove all references to JmsTemplate.

      I read that I can use Spring's SingleConnectionFactory to reuse the JMS connection.

      I have some question about this though.

      It's my understanding that a single QueueConnectionFactory can be shared among different threads - is that correct?

      It's also my understanding that a single connection created from a QueueConnectionFactory can be shared by multiple threads - is that correct?

      If that is all correct, then why do I keep on reading about JMS connection pooling if the connection can be shared ? If they can be shared, you don't need a pool, you just need one connection - right?

      I think I'm not understanding something correctly.

      Please enlighten me.