You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@gmail.com> on 2019/11/13 13:45:11 UTC

How to aggregate files after producer created all files?

Hi

I have a route that creates up to ten different files in a directory and another route that zips all these files.

We see in some scenarios that the zipping is done BEFORE all files have been created. Ending up with two zip files, one with eight files and one with two files.
The zip-route uses a delay, a completionFromBatchConsumer and eagerCheckCompletion.

How can I chain these two routes together so the zipping is always run after all files have been created?

My producer route creates files using a multicast and several .to("direct://“).


Thx

M

Re: How to aggregate files after producer created all files?

Posted by Mantas Gridinas <mg...@gmail.com>.
I suppose the solution would not be using the file component at all, but
rather agregating messages and using ZipOutputStream to convert those
messages into a zip file and only then to store it in the file system via
file component.

On Wed, Nov 13, 2019, 20:57 WEIQUAN YUAN <we...@gmail.com> wrote:

> can you use some indicator to check if all the files are created or not. If
> it is not true, you don't need to call another route in choice when
> condition.
>
> On Wed, Nov 13, 2019 at 8:45 AM Mikael Andersson Wigander <
> mikael.grevsten@gmail.com> wrote:
>
> > Hi
> >
> > I have a route that creates up to ten different files in a directory and
> > another route that zips all these files.
> >
> > We see in some scenarios that the zipping is done BEFORE all files have
> > been created. Ending up with two zip files, one with eight files and one
> > with two files.
> > The zip-route uses a delay, a completionFromBatchConsumer and
> > eagerCheckCompletion.
> >
> > How can I chain these two routes together so the zipping is always run
> > after all files have been created?
> >
> > My producer route creates files using a multicast and several
> > .to("direct://“).
> >
> >
> > Thx
> >
> > M
>
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Weiquan Yuan
> Located in Ottawa, Canada
>

Re: How to aggregate files after producer created all files?

Posted by WEIQUAN YUAN <we...@gmail.com>.
can you use some indicator to check if all the files are created or not. If
it is not true, you don't need to call another route in choice when
condition.

On Wed, Nov 13, 2019 at 8:45 AM Mikael Andersson Wigander <
mikael.grevsten@gmail.com> wrote:

> Hi
>
> I have a route that creates up to ten different files in a directory and
> another route that zips all these files.
>
> We see in some scenarios that the zipping is done BEFORE all files have
> been created. Ending up with two zip files, one with eight files and one
> with two files.
> The zip-route uses a delay, a completionFromBatchConsumer and
> eagerCheckCompletion.
>
> How can I chain these two routes together so the zipping is always run
> after all files have been created?
>
> My producer route creates files using a multicast and several
> .to("direct://“).
>
>
> Thx
>
> M



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Weiquan Yuan
Located in Ottawa, Canada