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