3 Replies Latest reply on Apr 9, 2015 9:42 AM by jbertram

    HornetQConnectionFactory implementation on TopicConnectionFactory and QueueConnectionFactory

    kaluibu

      Hi,

       

      I am upgrading from HornetQ 2.0.0.GA to HornetQ 2.4.0.Final.

       

      As of now, I am using a stand alone server with JMS 1.1.

      Please find below piece of code in my HornetQUtil.java file.

       

      HornetQUtil.java

       

      protected HornetQConnectionFactory createConnectionFactory(String url) throws JMSException

          {

              Properties props = new Properties();

              props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

              props.put("java.naming.provider.url", url);

              props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

             

              try

              {

                  InitialContext initialCtx = new InitialContext(props);           

                  return (HornetQConnectionFactory)initialCtx.lookup("/ConnectionFactory");

              } catch (NamingException e)

              {

                  // Wrap in JMS exception

                  throw new JMSException("Failed to lookup inital context for url - '" + url + "'", e.getMessage());

              }

          }

         

          @Override

          protected TopicConnectionFactory createTopicConnectionFactory(String url)

                  throws JMSException {

              return createConnectionFactory(url);

          }

         

          @Override

          protected QueueConnectionFactory createQueueConnectionFactory(String url)

                  throws JMSException {

              return createConnectionFactory(url);

          }

      ***************************************************************************************************************

      Here the Overridden methods implemented are declared in an abstract class.

       

       

      In HornetQ 2.0, HornetQConnectionFactory directley implements TopicConnectionFactory and QueueConnectionFactory which comes under javax.jms package.

      But in HornetQ 2.4 API, there is no direct implementation for HornetQConnectionFactory on TopicConnectionFactory and QueueConnectionFactory, but these are implemented by the child classes.

       

      What are the possible changes that needs to be done here while upgrading?