Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CamelContext context = new DefaultCamelContext();
- ConnectionFactory connectionFactory = null;
- // connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:5445");
- // HornetQConnectionFactory c = new HornetQConnectionFactory();
- connectionFactory = HornetQJMSClient.createConnectionFactory("127.0.0.1", 5455);
- Thread.sleep(1000);
- Connection connection = connectionFactory.createConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- final Properties env = new Properties();
- env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
- env.put(Context.PROVIDER_URL, "remote://localhost:4447");
- InitialContext context1 = new InitialContext(env);
- System.out.println("4");
- ConnectionFactory cf = (ConnectionFactory) context1.lookup("jms/RemoteConnectionFactory");
- System.out.println("5");
- Queue queue = (Queue) context1.lookup("jms/queue/someQueue");
- System.out.println("6");
- connection = cf.createConnection("vwjugow", "pass");
- System.out.println("7");
- session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- System.out.println("8");
Advertisement
Add Comment
Please, Sign In to add comment