You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by AndyBell <an...@dstglobalsolutions.com> on 2013/02/20 16:24:31 UTC

Move multiple files mid route...

Hi

Midway through my route, I need to look in a folder and move any files there
that meet a certain filename pattern into another folder.

I'm not getting far with this - I am trying to use a consumerTemplate  but
only the first file gets processed and the others end up with camel
lockfiles being created but nothing else happens...

What's the best approach for this - I would have thought it should be a
trivial task?

Andy



--
View this message in context: http://camel.465427.n5.nabble.com/Move-multiple-files-mid-route-tp5727879.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Move multiple files mid route...

Posted by AndyBell <an...@dstglobalsolutions.com>.
Thanks for the info.

Andy



--
View this message in context: http://camel.465427.n5.nabble.com/Move-multiple-files-mid-route-tp5727879p5728157.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Move multiple files mid route...

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Feb 20, 2013 at 4:24 PM, AndyBell
<an...@dstglobalsolutions.com> wrote:
> Hi
>
> Midway through my route, I need to look in a folder and move any files there
> that meet a certain filename pattern into another folder.
>
> I'm not getting far with this - I am trying to use a consumerTemplate  but
> only the first file gets processed and the others end up with camel
> lockfiles being created but nothing else happens...
>
> What's the best approach for this - I would have thought it should be a
> trivial task?
>

Sometimes its easier to just write a bit of java code. The
java.io.File API allows you to rename files.
As well list all files in a directory etc.

The ConsumerTemplate API is per message, so you cannot do *bulk*
message processing.

An alternative is to have a little Camel route that routes the files,
and when there is no more files, you stop this route.



> Andy
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Move-multiple-files-mid-route-tp5727879.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen