You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by axelf <ca...@orange.fr> on 2013/06/18 14:30:14 UTC

Consume opened excel file with ftp

Hello.

I'm sorry i'm really a newbie with Camel.

I'm using Camel to get file in a FTP server. Here how i'm routing it:



The file is a Excel file. When this file is not opened, the download and the
process work perfectly. Bug if the FTP server owner save the file in the ftp
directory (so it is still open in Excel), when trying to download the file,
an exception is thrown:



Just closing the file will resolve the problem.

Is there a solution to make it waiting to the file to be closed before
attempting to consume it?



--
View this message in context: http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consume opened excel file with ftp

Posted by Christian Müller <ch...@gmail.com>.
You can use the bridgeErrorHandler to discard this exception. Camel will
try to consume this file again in the next poll. But this is more a work
around...

You should consider to write the file into a different directory and move
it into the directory Camel is polling afterwards.

Best,
Christian

Sent from a mobile device
Am 18.06.2013 14:31 schrieb "axelf" <ca...@orange.fr>:

> Hello.
>
> I'm sorry i'm really a newbie with Camel.
>
> I'm using Camel to get file in a FTP server. Here how i'm routing it:
>
>
>
> The file is a Excel file. When this file is not opened, the download and
> the
> process work perfectly. Bug if the FTP server owner save the file in the
> ftp
> directory (so it is still open in Excel), when trying to download the file,
> an exception is thrown:
>
>
>
> Just closing the file will resolve the problem.
>
> Is there a solution to make it waiting to the file to be closed before
> attempting to consume it?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Consume opened excel file with ftp

Posted by axelf <ca...@orange.fr>.
Finally we decided to use the readLock=rename with a 20 sec timeout



Thanks;

Axel F



--
View this message in context: http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296p5734953.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consume opened excel file with ftp

Posted by axelf <ca...@orange.fr>.
So we finally added a spec for our clients about using excel files. They
shouldn't save directly to the ftp directory now, but I would like to send a
message to a queue with activeMQ when this happen.

We have no problem using ActiveMQ, but we don't know how to handle the
genericFileOperationFailedException exception: we tried to add the
onException clause like this (with just a log writing for the moment):



We tried also to try catch the process method, but we cannot handle this
exception.

It seems we have much to learn about Camel (we bought the book "Camel in
Action" elsewhere).



--
View this message in context: http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296p5734906.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consume opened excel file with ftp

Posted by axelf <ca...@orange.fr>.
Thanks for your answers. I'm going to work on it and eventually give a feed
back.

Thank you again.


(sorry for my english)



--
View this message in context: http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296p5734343.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Consume opened excel file with ftp

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

There is a number of readLock options you can try such as rename, changed etc.
See details at: http://camel.apache.org/file2.html

But Christian is right, its usually better to write the file in
another directory and move it when its done, or write the file using a
temporary name, and rename when done etc.

On Tue, Jun 18, 2013 at 2:30 PM, axelf <ca...@orange.fr> wrote:
> Hello.
>
> I'm sorry i'm really a newbie with Camel.
>
> I'm using Camel to get file in a FTP server. Here how i'm routing it:
>
>
>
> The file is a Excel file. When this file is not opened, the download and the
> process work perfectly. Bug if the FTP server owner save the file in the ftp
> directory (so it is still open in Excel), when trying to download the file,
> an exception is thrown:
>
>
>
> Just closing the file will resolve the problem.
>
> Is there a solution to make it waiting to the file to be closed before
> attempting to consume it?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Consume-opened-excel-file-with-ftp-tp5734296.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen