You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pvunckx <pi...@telenet.be> on 2012/07/19 09:14:37 UTC

process files in order

Hi,

What is the best practice for processing 4 files one after another? The
second may only start when the first is completely processed.
Ordering the files is not an issue, this is working.

For the moment I have 5 routes:
- One for the file poller (with sorter)
- 4 separate routes (direct) for each file (each has their own logic).

When I run this, the files aren't processed in the right sequence...

I was thinking in the direction of a wait-while (expression) thing but that
doesn't exist (I think)....

Someone has an idea how to handle this?

Thx
Pieter

--
View this message in context: http://camel.465427.n5.nabble.com/process-files-in-order-tp5716234.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: process files in order

Posted by pvunckx <pi...@telenet.be>.
Hi Claus,

Thx for your tip ! 
Indeed, I'm calling webservices in my subroutes > by adding the parameter
synchronous=true they run in sequence ....

I'll retry with a large amount of data now and post the result !!

Thx
Pieter

--
View this message in context: http://camel.465427.n5.nabble.com/process-files-in-order-tp5716234p5716244.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: process files in order

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 19, 2012 at 9:14 AM, pvunckx <pi...@telenet.be> wrote:
> Hi,
>
> What is the best practice for processing 4 files one after another? The
> second may only start when the first is completely processed.
> Ordering the files is not an issue, this is working.
>

This is the default behavior of the file consumer.

And if your connect routes with the direct component then its
synchronous as well.
So it should work processing in sequence.

You must do something in your routes that goes async / concurrent.

What do you do in your routes?


> For the moment I have 5 routes:
> - One for the file poller (with sorter)
> - 4 separate routes (direct) for each file (each has their own logic).
>
> When I run this, the files aren't processed in the right sequence...
>
> I was thinking in the direction of a wait-while (expression) thing but that
> doesn't exist (I think)....
>
> Someone has an idea how to handle this?
>
> Thx
> Pieter
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/process-files-in-order-tp5716234.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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