camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chirag Dewan <>
Subject Re: pollEnrich all the files in a directory
Date Sun, 04 May 2014 08:22:15 GMT
Hi Claus,

Thanks for the quick reply.

I have to consume all the files upon a command,and then stop the route from continuously polling
the files untill the next command comes. So,can I also stop the control bus once all my files
are consumed? Maybe from within the route?


Chirag Dewan

 From: Claus Ibsen <>
To: "" <> 
Sent: Sunday, 4 May 2014 1:23 PM
Subject: Re: pollEnrich all the files in a directory

On Sun, May 4, 2014 at 9:38 AM, Chirag Dewan <> wrote:
> Hi,
> Can I consume all the files in a directory,using poll enrich?
> My route would be something like :
> from("seda:abc").pollEnrich("file:/path/of/directory?delete=true).to("file:/path/of/output);
> And I send requests to the route with null body or blank body.
> context.createProducerTemplate().sendBody("seda:abc",null/"");
> BR,
> Chirag Dewan


No pollEnrich polls one file at a time.

You may try to use the control bus instead, to start a route that
moves the files.

route id = foo
from file dir
  to file outdir

And then use controlbus to send a message to start route with id = foo

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message