You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ebinsingh <eb...@VerizonWireless.com> on 2012/02/02 16:26:48 UTC

Compressing file after Move

Hi All,

We have an route which reads files, process them and then move them to a
back up location.
We would like to commpress these files that have been proceesed and then
move them to the back up location.

Is there a way to do this? 

Appreciate your help.

Thanks & regards,
Ebe

--
View this message in context: http://camel.465427.n5.nabble.com/Compressing-file-after-Move-tp5451023p5451023.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Compressing file after Move

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 2, 2012 at 6:28 PM, ebinsingh
<eb...@verizonwireless.com> wrote:
> Thanks, I tried using gzip (As we moved to Solaris) and it does work as
> expected.
> But my issue is to compress before moving the files to back up.
>
> <endpoint id="acquireltel2TAP"
> uri="file:/work_dir/data/input/tap?move=/work_dir/data/input/bkp/tap" />
>
> The above endpoint moves the file as such to the directory
> "/work_dir/data/input/bkp/tap". But we want the file to be compressed before
> being backed up.
>
> Is there a way of doing this.
>

Ah nice to know. No the ?move option on the camel endpoint will
*always* do a File IO move operation on the input file.

So you need to move the file in your Camel route instead, and use
noop=true&idempoten=false on the file endpoint uri.

Something along the lines off

from file
   do route stuff here
   gzip
   to (file:backup)

I guess it may be nice to have some way of gzip support built-in the
file endpoint.
It is a bit common to compress backup files.

However in the past I have done it outside Java using scripts on servers.
But some level of support in Camel would be nice.





> --
> View this message in context: http://camel.465427.n5.nabble.com/Compressing-file-after-Move-tp5451023p5451388.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Compressing file after Move

Posted by ebinsingh <eb...@VerizonWireless.com>.
Thanks, I tried using gzip (As we moved to Solaris) and it does work as
expected.
But my issue is to compress before moving the files to back up.

<endpoint id="acquireltel2TAP"
uri="file:/work_dir/data/input/tap?move=/work_dir/data/input/bkp/tap" />

The above endpoint moves the file as such to the directory
"/work_dir/data/input/bkp/tap". But we want the file to be compressed before
being backed up.

Is there a way of doing this.

--
View this message in context: http://camel.465427.n5.nabble.com/Compressing-file-after-Move-tp5451023p5451388.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Compressing file after Move

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Camel does not have a file compression component.

The zip data format is almost there, but it may not compress the
content using a File Zip API.
But I think there has been a contribution about this, there may be a
JIRA ticket with some code.

The JDK do have API for compressing using Zip, and in a zip file format.

On Thu, Feb 2, 2012 at 4:26 PM, ebinsingh
<eb...@verizonwireless.com> wrote:
> Hi All,
>
> We have an route which reads files, process them and then move them to a
> back up location.
> We would like to commpress these files that have been proceesed and then
> move them to the back up location.
>
> Is there a way to do this?
>
> Appreciate your help.
>
> Thanks & regards,
> Ebe
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Compressing-file-after-Move-tp5451023p5451023.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/