camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: programatic access to jms queue
Date Mon, 08 Jun 2015 09:56:49 GMT
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.ml@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: cibsen@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/

Mime
View raw message