Even when there is no change in the file it starts parsing it from the first 
line every second:


<from 
uri="stream:file?fileName=sample.csv&amp;scanStream=true&amp;scanStreamDelay=1000&amp;retry=true"
 />


I use Camel version 2.16.3.


Maybe an option in Camel could be to use the Apache Commons IO Tailer 
implementation similar to Apache Karaf Decanter here:

https://github.com/apache/karaf-decanter/blob/master/collector/file/src/main/java/org/apache/karaf/decanter/collector/file/DecanterTailerListener.java


Thanks

Oli



________________________________
Von: Claus Ibsen <[email protected]>
Gesendet: Montag, 27. März 2017 11:13:58
An: [email protected]
Betreff: Re: file input with tail -f behaviour

What do you mean by start from beginning?

It ought to read line by line when the file is appended. And if a new
file is created it starts from top again.
If you shutdown Camel, it does not remember where it was last time,
and start all over again

On Fri, Mar 24, 2017 at 11:28 AM, Oliver Wulff <[email protected]> wrote:
> Hi there
>
>
> I've tried to use the stream input component to listen on changes within a 
> file to process the lines one by one.
>
>
> <from 
> uri="stream:file?fileName=sample.csv&amp;scanStream=true&amp;scanStreamDelay=1000&amp;retry=true"
>  />
>
>
> But I noticed it always starts from the beginning. Is there an option in 
> Camel to have "tail -f" behaviour to trigger my route?
>
>
> Thanks
>
> Oli
>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Claus Ibsen (@davsclaus) riding the Apache Camel<http://davsclaus.com/>
davsclaus.com
A blog about Apache Camel, by Claus Ibsen, the leading contributor, and author 
of the Camel in Action book.



Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to