Hi,
this is because JMS temporary Objects are usually bound to the connect
in which they have been created.
Therefore these are invisible elsewhere. You are using contexts and I
would assume you are using the normal setup
and hace 2 connections.
This is why it doesn't work with a temp queue, but it does with a normal
queue.
Best regards
Andreas
On 09/08/2013 05:14 PM, Nhan Nguyen wrote:
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.