3 Replies Latest reply on Jun 3, 2004 9:37 AM by Adrian Brock

    Binding topic connection to JNDI

    mylesj Newbie

      We are facing an awkward scenario when sending JMS messages from within an EJB. We want to be able to cache a topic connection and reuse it rather than create a new one each time an EJB publishes a message. The connection factory seems to create a new physical connection each time rather than reusing them which eats up loads of resources - thats why we want to cache the connection.

      Obviously caching a connection in a static variable (the singleton pattern) is an obvious choice, but then this is subject to the vagaries of classloading by JBoss as to how many instances actually get created.

      Therefore, I wonder whether it is feasible to create a topic connection and bind in to JNDI?

      Are there any other options?