Hi

This is correct. The consumer will keep running until you call stop.
Mind the start method is not blocking.

On Mon, Jun 8, 2015 at 11:24 AM, Tim Dudgeon <tdudgeon...@gmail.com> wrote:
> 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



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to