conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
JMSConfiguration configuration = new JMSConfigurationImpl();
context = new InVMContext();
configuration.setContext(context);
configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl(queueName, null, true, queueName));
ArrayList<TransportConfiguration> configs = new ArrayList<TransportConfiguration>();
configs.add(new TransportConfiguration(NettyConnectorFactory.class.getName()));
ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf",
false,
registerConnectors(server, configs), "/cf");
cfConfig.setRetryInterval(1000);
cfConfig.setRetryIntervalMultiplier(1.0);
cfConfig.setReconnectAttempts(-1);
configuration.getConnectionFactoryConfigurations().add(cfConfig);
serverManager = new JMSServerManagerImpl(server, configuration);
serverManager.start();
listener = new Listener();