vwjugow

code3

Feb 1st, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. CamelContext context = new DefaultCamelContext();
  2. ConnectionFactory connectionFactory = null;
  3. // connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:5445");
  4. // HornetQConnectionFactory c = new HornetQConnectionFactory();
  5. connectionFactory = HornetQJMSClient.createConnectionFactory("127.0.0.1", 5455);
  6. Thread.sleep(1000);
  7. context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
  8. context.addRoutes(new RouteBuilder() {
  9. public void configure() {
  10. from("jms:queue:someQueue").to("file://test");
  11. }
  12. });
  13. ProducerTemplate template = context.createProducerTemplate();
  14. context.start();
  15. template.sendBody("jms:queue:someQueue", "Test MessageASD");
  16. Thread.sleep(10000);
  17. context.stop();
Advertisement
Add Comment
Please, Sign In to add comment