You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nserra <ns...@hotmail.com> on 2011/09/29 16:31:38 UTC

Copy File - catch non existing file

Hello

I have a route that copy each hour a file and process it, but, at some part
of the day the file won't be there and I wan't to catch this to look at
another file in another folder is this possible?

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Copy-File-catch-non-existing-file-tp4853329p4853329.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Copy File - catch non existing file

Posted by Nserra <ns...@hotmail.com>.
I'll try your approach and then give feedback. 
Tks for the ticket


--
View this message in context: http://camel.465427.n5.nabble.com/Copy-File-catch-non-existing-file-tp4853329p4864210.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Copy File - catch non existing file

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

I have created a ticket
https://issues.apache.org/jira/browse/CAMEL-4508

On Sun, Oct 2, 2011 at 9:18 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Thu, Sep 29, 2011 at 4:31 PM, Nserra <ns...@hotmail.com> wrote:
>> Hello
>>
>> I have a route that copy each hour a file and process it, but, at some part
>> of the day the file won't be there and I wan't to catch this to look at
>> another file in another folder is this possible?
>>
>
> You can implement a PollingConsumerPollStrategy and in the commit
> method you will have 0 in the polledMessage parameter.
> http://camel.apache.org/file2
>
> You can configure it on the endpoint as "consumer.pollStrategy=#myPollStrategy"
> And have a <bean id="myPollStrategy" class="com.foo.MyPollStrategy"/>
>
> But we should possible look into making this easier for consumers who
> is is scheduled poll based, and have an easier way to do this.
>
>
>
>> Thanks
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Copy-File-catch-non-existing-file-tp4853329p4853329.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/
>



-- 
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: Copy File - catch non existing file

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 29, 2011 at 4:31 PM, Nserra <ns...@hotmail.com> wrote:
> Hello
>
> I have a route that copy each hour a file and process it, but, at some part
> of the day the file won't be there and I wan't to catch this to look at
> another file in another folder is this possible?
>

You can implement a PollingConsumerPollStrategy and in the commit
method you will have 0 in the polledMessage parameter.
http://camel.apache.org/file2

You can configure it on the endpoint as "consumer.pollStrategy=#myPollStrategy"
And have a <bean id="myPollStrategy" class="com.foo.MyPollStrategy"/>

But we should possible look into making this easier for consumers who
is is scheduled poll based, and have an easier way to do this.



> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Copy-File-catch-non-existing-file-tp4853329p4853329.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/