You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yxzhao <yx...@stonewain.com> on 2014/07/10 20:32:40 UTC

How to check if the file waiting in enricher arrived after timeout

Hi there,

We need to run a job in certain time window only once a day and it also
depends on a trigger file. It needs to be also started if the application
started after the starting time point of the time window. Periodically
checking for the trigger file with a timeout as defined below fails us since
we don't know how to check the existence of the trigger after pollEnrich
times out. It always calls doSomething.

<route id="test">
<from uri="quartz://sodJob?stateful=true&amp;cron=0+*/5+3-6+?+*+*"/-->
     <pollEnrich uri="file:{{data_home}}/Bod?fileName=START"
timeout="60000"/>
      <transacted/>
      <to uri="bean:utilBean?method=doSomething"/>
 </route>

Any ideas how to check if the pollEnrich timed out or the trigger file
arrived?

Thanks in advance.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-check-if-the-file-waiting-in-enricher-arrived-after-timeout-tp5753654.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to check if the file waiting in enricher arrived after timeout

Posted by yxzhao <yx...@stonewain.com>.
Yes, it works now. I thought if the file is empty, the body will be null.
Apparently, there is difference between no file and empty file.

Thanks for your help.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-check-if-the-file-waiting-in-enricher-arrived-after-timeout-tp5753654p5753731.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to check if the file waiting in enricher arrived after timeout

Posted by Willem Jiang <wi...@gmail.com>.
I think you need to check if the message body null before calling the bean method of doSomething.

-- 
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On July 11, 2014 at 8:56:08 AM, yxzhao (yxzhao@stonewain.com) wrote:
> Hi there,
>  
> We need to run a job in certain time window only once a day and it also
> depends on a trigger file. It needs to be also started if the application
> started after the starting time point of the time window. Periodically
> checking for the trigger file with a timeout as defined below fails us since
> we don't know how to check the existence of the trigger after pollEnrich
> times out. It always calls doSomething.
>  
>  
>  
> > timeout="60000"/>
>  
>  
>  
>  
> Any ideas how to check if the pollEnrich timed out or the trigger file
> arrived?
>  
> Thanks in advance.
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-check-if-the-file-waiting-in-enricher-arrived-after-timeout-tp5753654.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>