camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6574) FTP consumer does not detect file changes
Date Tue, 06 Aug 2013 16:36:52 GMT

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

Chris Lee commented on CAMEL-6574:
----------------------------------

I had a similar issue and stepped through the code. IMHO, it has to do with the end point's
internal inprogressIdempotentRepository not clearing under certain circumstances.

The problem arise when you use have file names that do not change. In this case, you typically
use the new custom idempotent key:

        from("ftp://" + this.user
                + "@" + this.host
                + ":" + this.port
                + this.ftpDir.trim()
                + "?password=" + this.pass
                // Poll every minute
                + "&delay=60000"
                // Site is Read-Only, so do not attempt any operation on remote FTP.
                // NOTE: This implies idempotent=true
                + "&noop=true"
                // Add timestamp to the key, so that we only process files that are new
                + "&idempotentKey=${file:onlyname}-${file:size}-${date:file:yyyyMMddHHmmss}"
                // Use PASV FTP
                + "&passiveMode=true").
                routeId(this.getClass().getSimpleName()).
                to("log:com.psi.camel?showAll=true&multiline=true").
                to("file://" + dir.getAbsolutePath()
                + "?fileName=" + fileName
                + "&autoCreate=true"
                + "&fileExist=Override");

When the route executes the first time, all files are new (since its a memory based cache),
and all is fine:
a) Filenames added to inprogress cache, 
b) custom idempotent keys added to end point idempotent cache, 
c) files processed
d) inprogress cache cleared.

When the route runs again,
a) Filenames added to inprogress cache, 
b) custom idempotent keys exists, 
c) files not processed
d) inprogress cache not cleared.

Hope this helps.

Thanks vm
                
> FTP consumer does not detect file changes
> -----------------------------------------
>
>                 Key: CAMEL-6574
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6574
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.11.1
>         Environment: GNU/Debian 6.0, Java 1.7 
>            Reporter: Alberto Brosich
>
> I have a route with an FTP consumer with the following options:
> delay=1800000
> disconnect=true
> fileName=xxxxx.yyy
> idempotent=true
> idempotentKey=${file:name}-${file:size}
> maxMessagesPerPoll=1
> noop=true
> readLock=changed
> sortBy=file:modified
> Upgrading from camel 2.11.0 to 2.11.1 the FTP consumer does not detect changes in the
file.
> I tried several idempotentKey without success.
> Reverting to 2.11.0 works all fine.
> I did not find any relevant info in the release notes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message