1 Reply Latest reply on Aug 5, 2011 12:26 AM by clebert.suconic

    The JMS Pojo Instantiation example does not compile under version 2.2.5

    david.berkman

      The documentation for HornetQ version 2.2.5.Final, under JMS Pojo Instantiation (section 43.2) has this code as an example...

       

      Configuration configuration = new ConfigurationImpl();
      configuration.setPersistenceEnabled(false);
      configuration.setSecurityEnabled(false);
      configuration.getAcceptorConfigurations()
        .add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));

       

      // Step 2. Create the JMS configuration

      JMSConfiguration jmsConfig = new JMSConfigurationImpl();

       

      // Step 3. Configure the JMS ConnectionFactory

      TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", connectorConfig, "/cf");
      jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);

       

      // Step 4. Configure the JMS Queue

      JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "/queue/queue1");
      jmsConfig.getQueueConfigurations().add(queueConfig);

       

      // Step 5. Start the JMS Server using the HornetQ core server and the JMS configuration

      EmbeddedJMS jmsServer = new EmbeddedJMS();
      jmsServer.setConfiguration(configuration);
      jmsServer.setJmsConfiguration(jmsConfig);

      jmsServer.start();

       

      ...which does not compile. The constructor 'ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", connectorConfig, "/cf");' is unavailable. I've tried some alternates but can't seem to get this right. Anyone have the documentation for the working example?

       

      Thanks,
      David