You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alex <al...@gmx.de> on 2013/12/20 16:39:30 UTC

Zipping multiple files to one Zip-File

Dear Community, 

I'm new to Camel (2.12.0) and like it very much. I'm trying to build a zip
route which handles a lot of PDF-Files and zip them all together to one
Zip-File. No success so far :-(

        from("direct:zip")
        	.from("file:c:/temp/camel/batch/result?move=.moved&include=.*pdf")
        	.marshal().zipFile()
        	.to("file:c:/temp/camel/batch/result/zip?fileName=${file:name}");

at the end, i'm getting one zip for every pdf file. 
Is my approach completely wrong?
Best regards
Alex (from Germany)



--
View this message in context: http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-File-tp5745128.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Zipping multiple files to one Zip-File

Posted by Richard Kettelerij <ri...@gmail.com>.
You'll need the aggregator EIP, http://camel.apache.org/aggregator2.html.
It's a perfect fit for this case.


On Fri, Dec 20, 2013 at 4:39 PM, alex <al...@gmx.de> wrote:

> Dear Community,
>
> I'm new to Camel (2.12.0) and like it very much. I'm trying to build a zip
> route which handles a lot of PDF-Files and zip them all together to one
> Zip-File. No success so far :-(
>
>         from("direct:zip")
>
> .from("file:c:/temp/camel/batch/result?move=.moved&include=.*pdf")
>                 .marshal().zipFile()
>
> .to("file:c:/temp/camel/batch/result/zip?fileName=${file:name}");
>
> at the end, i'm getting one zip for every pdf file.
> Is my approach completely wrong?
> Best regards
> Alex (from Germany)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-File-tp5745128.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Zipping multiple files to one Zip-File

Posted by Pontus Ullgren <ul...@gmail.com>.
Here is a AggregationStrategy, that I'm using in a project, that
aggregates all incoming messages into a ZIP file.
It uses a temporary file to store the data in between messages.

https://gist.github.com/ullgren/8160215


Best regards
Pontus


On Fri, Dec 27, 2013 at 8:23 PM, alex <al...@gmx.de> wrote:
> Thank you very much, i'll try to aggregate the messages and zip them. Let you
> know about my progress soon :-)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-File-tp5745128p5745289.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Zipping multiple files to one Zip-File

Posted by alex <al...@gmx.de>.
Thank you very much, i'll try to aggregate the messages and zip them. Let you
know about my progress soon :-)



--
View this message in context: http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-File-tp5745128p5745289.html
Sent from the Camel - Users mailing list archive at Nabble.com.

AW: Zipping multiple files to one Zip-File

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
I am missing a part which Camel instructs to collect the exchanges and not
to process every for its own ...

Jan

> -----Ursprüngliche Nachricht-----
> Von: alex [mailto:alex.koerky@gmx.de]
> Gesendet: Freitag, 20. Dezember 2013 16:39
> An: users@camel.apache.org
> Betreff: Zipping multiple files to one Zip-File
> 
> Dear Community,
> 
> I'm new to Camel (2.12.0) and like it very much. I'm trying to build a
> zip route which handles a lot of PDF-Files and zip them all together to
> one Zip-File. No success so far :-(
> 
>         from("direct:zip")
> 
> 	.from("file:c:/temp/camel/batch/result?move=.moved&include=.*pdf"
> )
>         	.marshal().zipFile()
> 
> 	.to("file:c:/temp/camel/batch/result/zip?fileName=${file:name}");
> 
> at the end, i'm getting one zip for every pdf file.
> Is my approach completely wrong?
> Best regards
> Alex (from Germany)
> 
> 
> 
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-
> File-tp5745128.html
> Sent from the Camel - Users mailing list archive at Nabble.com.