I'm wanting to programatically access a JMS queue on a dynamic basis, but use the Camel infrastructure to do this.
I've tried something like this:

JmsEndpoint jms = getCamelContext().getEndpoint("activemq:queue:myqueue", JmsEndpoint.class);
JmsConsumer consumer = jms.createConsumer((Exchange exchange) -> {
Object body = exchange.getIn().getBody();
System.out.println("BODY: " + body);
});
consumer.start();

But this only processes the first message in the queue.
How should I be doing this?


Tim

Reply via email to