Hi all, I have 2 machines, one for producer and one for consumer. Sometime I need to create some temp queues for sending/receiving messages. But I see that I can not use temp queue this case. All messages are lot. I suspect the cause is due to using 2 different camel contexts so I wrote below code to test:
JmsEndpoint endpoint1 = c1.getCamelContext().getEndpoint("activemq:temp:queue:t", JmsEndpoint.class); JmsEndpoint endpoint2 = c2.getCamelContext().getEndpoint("activemq:temp:queue:t", JmsEndpoint.class); Consumer consumer = endpoint2.createConsumer(new Processor() { @Override public void process(Exchange exchange) throws Exception { System.out.println(exchange.getIn().getBody()); } }); consumer.start(); ProducerTemplate producer = c1.getCamelContext().createProducerTemplate(); Exchange exchange = endpoint1.createExchange(); exchange.getIn().setBody("test"); producer.send(endpoint1, exchange); And the result the consumer could not receive message "test"... I changed the temp queue "t" to physical queue ("activemq:queue:t") and it works fine... Can someone explain the reason and how can I use temp queue this case? I am using ActiveMQ 5.8.0 and Camel 2.11.0. Thanks, Nhan -- View this message in context: http://camel.465427.n5.nabble.com/Can-not-consume-messages-which-are-sent-to-temp-queue-using-2-different-camel-contexts-tp5738891.html Sent from the Camel - Users mailing list archive at Nabble.com.