[ 
https://issues.apache.org/jira/browse/CAMEL-21947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17943216#comment-17943216
 ] 

Håkan Lantz commented on CAMEL-21947:
-------------------------------------

We believe that this is not desirable behavior and the proposed fix is ​​to 
remove the idempotence key from the idempotence repository if the 
[GenericFileConsumer|https://github.com/apache/camel/blob/eb4a1ea7543aa172d7cd662a7dfa5867616aec13/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java#L255]
 here detects that it failed to start the processing of the file.

{code:java}
if (!started) {
        // if we did not start process the file then decrement the counter
        answer--;

        // If the idempotence of the endpoint is eager then
        // Remove the idempotent key from the repository
        GenericFile file = exchange.getMessage().getBody(GenericFile.class);
        if (null != file) {
                removeExcessiveIdempotentFile(file, exchange);
        }
{code}


> GenericFileConsumer with eager idempotence and read lock stop processing file
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-21947
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21947
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-file, camel-ftp
>    Affects Versions: 4.8.6, 4.10.3, 4.11.0
>            Reporter: Håkan Lantz
>            Priority: Major
>
> Hello,
> We have found a problem with the SftpConsumer (that applies for all file 
> cosumers).
> When it has been configured with "readLock=changed" and 
> "idempotentEager=true" the _GenericFileConsumer_ will in the _poll_ method:
>  # On the call to the _pollDirectory_ method store the idempotence key in the 
> idempotence repository (using the notUnique method)
>  # On the call to the _processBatch_ method it may fail to acquire a read 
> lock before the specified _readLockTimeout_ has been reached.
> When this occurs the file is silently left on the SFTP server and will not be 
> picked up.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to