-1

How to add log message before ftp starts ? to following route:

from("ftp://...idempotentKey=..&idempotentRepository=#MyRepo&delay=..")
    .to("file://folder/output");
  1. Log message should contain that ftp started.
  2. Log message should contain filter result whether file processed before or not.
  3. This messages have logLevel=INFO

pollEnrich is not a solution.

1 Answers1

0

The way you wrote it, your route is starting as soon execution is hitting your "from" instruction, then you can log the beginning with a simple java log instruction just before.

Additionally, you can also delay, change startup order, or remove automatic start, documented here.

To your second question, about logging your ftp client activity, you can do it that way:

from("ftp://...idempotentKey=..&idempotentRepository=#MyRepo&delay=..")
.log("Processing ${file:name}")
.to("file://folder/output");
fliot
  • 1
  • 2
  • .log(...) is not printed because of route is not reached to this point. idempotent key will be duplicate second time. so this solution is not good. – Sitnikov Artem Sep 04 '18 at 14:42
  • Then you can log the beginning with a simple java log instruction just before. as said... – fliot Sep 05 '18 at 11:08