You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Manish <ma...@gmail.com> on 2015/08/13 21:01:18 UTC

Want to keep original file but want to delete done file.

Hi,

I am new to camel..
My requirement is: I want to consume file using file endpoint, but I want to
keep the file as it is, so that other application can read this file..but
want to delete the donefile so that it should not processed again by my
application.

eg: shipment.xml : file to be consumed
     shipment.trg : done file, shipment.xml will be procced only when its
trg file exist..

After processing, shipment.trg file should be deleted and shipment.xml file
should be as it is..

I tried with...
<from
uri="file:inbound/source?noop=true&amp;delay=3000&amp;directoryMustExist=true&amp;doneFileName!=${file:name.noext}.trg"/> 
		  
In this case, both file exists..

How can I achieve it..

Thanks
Manish



--
View this message in context: http://camel.465427.n5.nabble.com/Want-to-keep-original-file-but-want-to-delete-done-file-tp5770697.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Want to keep original file but want to delete done file.

Posted by Claus Ibsen <cl...@gmail.com>.
There is no support for deleting only the done file. You would need to
delete it manually, you can add a step in the route that does this at
the end.


On Thu, Aug 13, 2015 at 9:01 PM, Manish <ma...@gmail.com> wrote:
> Hi,
>
> I am new to camel..
> My requirement is: I want to consume file using file endpoint, but I want to
> keep the file as it is, so that other application can read this file..but
> want to delete the donefile so that it should not processed again by my
> application.
>
> eg: shipment.xml : file to be consumed
>      shipment.trg : done file, shipment.xml will be procced only when its
> trg file exist..
>
> After processing, shipment.trg file should be deleted and shipment.xml file
> should be as it is..
>
> I tried with...
> <from
> uri="file:inbound/source?noop=true&amp;delay=3000&amp;directoryMustExist=true&amp;doneFileName!=${file:name.noext}.trg"/>
>
> In this case, both file exists..
>
> How can I achieve it..
>
> Thanks
> Manish
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Want-to-keep-original-file-but-want-to-delete-done-file-tp5770697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Re: Want to keep original file but want to delete done file.

Posted by Manish <ma...@gmail.com>.
Thanks for the response..
I have created a java bean to delete the trigger file..

I have another doubt using the CamelSplitComplete property..
${property.CamelSplitComplete}
I wanted to delete trigger file only if ${property.CamelSplitComplete} is
true..

                     <choice>
		       	<when>
		          <simple>${property.CamelSplitComplete} = true </simple>
		          <log message="message process completed.. Now delete trigger
file"/>                             
		          <to
uri="bean:fileDelete?method=deleteFile(src/tp-inbound/source/${file:name.noext}.trg)"/> 		     
		        </when>		        
		      </choice>	 

But this condition
 <simple>${property.CamelSplitComplete} = true </simple>  is not working..
IF I create any header and compare... I am able to do.. but with 
${property.CamelSplitComplete} I am not able to do that..

Can you please let me know what is the issue in my code??



--
View this message in context: http://camel.465427.n5.nabble.com/Want-to-keep-original-file-but-want-to-delete-done-file-tp5770697p5770787.html
Sent from the Camel - Users mailing list archive at Nabble.com.