0

I am developing a route to download files from a FTP location batch-wise. Please find below my route -

**from("ftp://user@ftphost/inbox?password=XXXX&binary=true&recursive=true")
            .log("Batch Index = ${header.CamelFileBatchIndex}, Batch Size = ${header.CamelFileBatchSize}")
            .to("file:outbox");**

The route works fine and all the files are downloaded. But the batch details (i.e. CamelFileBatchIndex and CamelFileBatchSize) are not getting logged.

Please find below the output -

**2016-06-28 18:56:24.600  INFO 8696 --- [           main] com.camel.examples.CamelApplication      : Started CamelApplication in 9.814 seconds (JVM running for 11.237)**

**2016-06-28 18:56:28.594  INFO 8696 --- [/inbox] route1                                   : Batch Index = , Batch Size =**
Kenster
  • 23,465
  • 21
  • 80
  • 106

1 Answers1

0

You are using the wrong names for those fields. You can find their constant values here: http://camel.apache.org/maven/current/camel-core/apidocs/constant-values.html#org.apache.camel.Exchange.BATCH_INDEX

Its CamelBatchSize and CamelBatchIndex

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks. The field names you suggested worked. However, I got the field names from [here](http://camel.apache.org/ftp2.html#FTP2-MessageHeaders). Maybe, the camel documentation needs some modification. – Arunava Pal Jun 30 '16 at 07:17