-1

I have 2 routes:

first:

....
.to("file://" + REST_FILES + "?fileName=${header.filename}");

second:

from("file://" + REST_FILES + "?idempotent=true")
....

But camel doesn't route files in case if I try to transfer same file repeatedly.

I want to have a place(callback for example) if file is not passed to the next pipeline. How can I achieve it?

P.S.

I tried to write:

 .to("file://" + REST_FILES + "?fileName=${header.filename}")
       .otherwise().process(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                logger.info("{}",exchange);
            }
        });

but it doesn't invoke

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

0

You cannot do that as you say idempontent=true which means it will not pickup files with the same name again (eg is a duplicate).

You can just test it by seeing if the file stays in that directory for a while, eg the file consumer does NOT pickup the file. If the file stays there, then its a duplicate.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65