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));
ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf",
new TransportConfiguration(NettyConnectorFactory.class.getName()),
"/cf");
cfConfig.setRetryInterval(1000);
cfConfig.setRetryIntervalMultiplier(1.0);
cfConfig.setReconnectAttempts(-1);
cfConfig.setFailoverOnServerShutdown(true);
configuration.getConnectionFactoryConfigurations().add(cfConfig);
serverManager = new JMSServerManagerImpl(server, configuration);
serverManager.start();
listener = new Listener();