Hi
You maybe need to start the file idempotent repo using .start().
It should log a debug level that it loaded from the store
LOG.debug("Loaded {} to the 1st level cache from idempotent
filestore: {}", cache.size(), fileStore);
Do you not see that debug logging ?
On Wed, Jul 9, 2014 at 11:39 PM, dermoritz <[email protected]> wrote:
> I have created a route that consumes from ftp:
>
> private RouteDefinition ftpRouteOcs() {
> IdempotentRepository<String> fileRep =
> FileIdempotentRepository.fileIdempotentRepository(new
> File("./downLoadedOcs"), A_MILLION, TEN_MB);
> // from endpoint
> FtpEndpoint<?> ftpEndpoint =
> getContext().getEndpoint(config.ftpUrlOcs(), FtpEndpoint.class);
> ftpEndpoint.setIdempotentKey("${file:name}");
> ftpEndpoint.setIdempotentRepository(fileRep);
> ftpEndpoint.getConfiguration().setBinary(true);
> //important!
> ftpEndpoint.getConfiguration().setStepwise(false);
> // no write or move operations - read only, set idempotent to true
> ftpEndpoint.setNoop(true);
> // only include files that match pattern
> ftpEndpoint.setInclude(OCS_FILE_FILTER_PATTERN);
> // fetch 1000 files in one poll...
> ftpEndpoint.setMaxMessagesPerPoll(FTP_MAX_FILES_PER_POLL);
> // but sort ALL files before...
> ftpEndpoint.setEagerMaxMessagesPerPoll(false);
> // ...by file name
> ftpEndpoint.setSortBy("file:name");
> // to endpoint
> FileEndpoint fileEndpoint = getContext().getEndpoint("file:" +
> config.ftpTargetOcs(), FileEndpoint.class);
> // mark finished downloads
> fileEndpoint.setDoneFileName("${file:name}.done");
> // ignore if exist
> fileEndpoint.setFileExist(GenericFileExist.Ignore);
> return
> from(ftpEndpoint).to(fileEndpoint).routeId(RouteIds.ftpOcs.name());
> }
>
> As you see i am using fileIdempotentRepository. The file is created fine and
> each file downloaded is added to the file - i get all related debug outputs.
> The problem is after a restart all files are downloaded again - the
> repository is ignored. The file is still there and on each run the file is
> updated - with the same data (create date keeps the same, change date is
> updated).
> so what is be wrong with my setup?
>
> Thanks in advance
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-ftp-consumer-ignores-idempotent-file-repository-on-start-tp5753615.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/