I'm attempting to consume messages from an file using an idempotent Key to
ensure that I consume the messages from the newly generated files by rolling
over the old one.

Here is my file component route

from("file:myFolder?noop=true&fileName=Myfile.json&idempotent=true&idempotentKey=${file:modified}-${file:size})

When I start my application for the first time, everything working fine and
also able to consume the messages from the newly generated files by rolling
over the old one.

When i restart the application it is reading the current file from the
beginning, instead of reading it from where it is left.

To resolve the above issue i tried using idempotent repo. But when the
current file(Myfile.json) gets modified, it is reading the file from the
beginning.

Here is my idempotent repo configuration
<bean id="fileStore"
class="org.apache.camel.processor.idempotent.FileIdempotentRepository">
    <property name="fileStore" value="target/.filestore.dat"/>
    <property name="maxFileStoreSize" value="512000"/>
    <property name="cacheSize" value="250"/>
</bean>

Here is my route
from("file:myFolder?noop=true&fileName=Myfile.json&idempotent=true&idempotentKey=${file:modified}-${file:size}&idempotentRepository=#fileStore")

Am i missing something here?



--
View this message in context: 
http://camel.465427.n5.nabble.com/File-component-reading-files-from-beginning-if-the-application-gets-restarted-tp5766163.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to