You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ilya S <de...@gmail.com> on 2010/10/29 21:11:52 UTC

Creating a Polling JMS consumer in Java DSL route

I'm on Camel 2.3 with ActiveMQ 5.3.2.

I am working with a set of slow JMS consumers, and I'd like to be able to
create them as polling consumers in my route defined in Java DSL. Is this
possible?
Can anyone show an example?

The reason I want polling jms consumers is because I cannot set "prefetch"
option to 0 with regular consumers. My understanding is that when I define a
route as follows:

from("activemq:queue.... ")
 ...

Camel creates a JMS consumer. Is there a way to instruct Camel to create a
polling consumer here?

Thank you very much for your help.

Ilya

Re: Creating a Polling JMS consumer in Java DSL route

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Oct 29, 2010 at 9:11 PM, Ilya S <de...@gmail.com> wrote:
> I'm on Camel 2.3 with ActiveMQ 5.3.2.
>
> I am working with a set of slow JMS consumers, and I'd like to be able to
> create them as polling consumers in my route defined in Java DSL. Is this
> possible?
> Can anyone show an example?
>
> The reason I want polling jms consumers is because I cannot set "prefetch"
> option to 0 with regular consumers. My understanding is that when I define a
> route as follows:
>

Why not? Ask at AMQ forum what and how you can configure AMQ.

> from("activemq:queue.... ")
>  ...
>
> Camel creates a JMS consumer. Is there a way to instruct Camel to create a
> polling consumer here?
>

No you cant as the above syntax will create an event driven JMS consumer.

You can use a timer endpoint to trigger the poll at every X interval.
Then you can pollEnrich from a JMS queue to poll a message (which will
use the polling JMS consumer)
http://camel.apache.org/content-enricher.html

> Thank you very much for your help.
>
> Ilya
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/