Apache Camel:FTP 批量消费者不打印文件批量索引和文件批量大小

Apache Camel: FTP batch consumer doesn't print file batch index and file batch size

我正在开发一种从 FTP 位置批量下载文件的路径。请在我的路线下方找到 -

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

路由正常,所有文件都已下载。但是批次详细信息(即 CamelFileBatchIndex 和 CamelFileBatchSize)没有被记录下来。

请在下面找到输出 -

**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 =**

您为这些字段使用了错误的名称。您可以在此处找到它们的常量值:http://camel.apache.org/maven/current/camel-core/apidocs/constant-values.html#org.apache.camel.Exchange.BATCH_INDEX

CamelBatchSizeCamelBatchIndex