<p>We are working on migrating our application into kubernetes. We use apache camel to process very large files. But the problem is that when we migrate to kubernetes, there will be more than one pod and there is high chance that pods often restart. If the restart happens in the middle of the processing of a huge file,</p>

<ol>
<li>Will there be any chance of camellock not getting released from the file?</li>
<li>Will the restart make the file to be processed from first, rather than being started from where the process has left?</li>
</ol>

karthik kannan B
<p>I acknowledge that there are a lot of situations that can lead to a pod restart in a Kubernetes cluster, but the problems you describe applies to camel applications running outside Kubernetes as well. </p>

<p>To answering your questions, in case of an application restart in the middle of the processing of a large file, according to file component documentation <a href="https://github.com/apache/camel/blob/master/camel-core/src/main/docs/file-component.adoc" rel="nofollow noreferrer">https://github.com/apache/camel/blob/master/camel-core/src/main/docs/file-component.adoc</a>:</p>

<ol>
<li>eventually the camel lock will be released, timing depends on which
way you provide the file to the pod.</li>
<li>if the processing has not correctly finished and the file has not been modified during the processing, then the processing will restart from the file beginning.</li>
</ol>

<p>That said there are strategies and EIP that can be applied and used like splitter <a href="http://camel.apache.org/splitter.html" rel="nofollow noreferrer">http://camel.apache.org/splitter.html</a> and idempotent consumers <a href="http://camel.apache.org/idempotent-consumer.html" rel="nofollow noreferrer">http://camel.apache.org/idempotent-consumer.html</a> to split the file in chunks and avoid reprocessing same chunks.</p>
