Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ApacheCamel文件组件";“幂等存储库”;选项与幂等消费处理器?_Java_Apache Camel - Fatal编程技术网

Java ApacheCamel文件组件";“幂等存储库”;选项与幂等消费处理器?

Java ApacheCamel文件组件";“幂等存储库”;选项与幂等消费处理器?,java,apache-camel,Java,Apache Camel,在的文档中,我看到可以通过如下方式指定幂等选项来创建幂等读锁: from("file://inbox?idempotent=true&idempotentRepository=#messageIdRepo") .to("file:data/outbox"); from("file:data/inbox?noop=true") .idempotentConsumer(header("CamelFileName"), someMessageIdRepository)

在的文档中,我看到可以通过如下方式指定
幂等
选项来创建幂等读锁:

from("file://inbox?idempotent=true&idempotentRepository=#messageIdRepo")
    .to("file:data/outbox");
from("file:data/inbox?noop=true")
    .idempotentConsumer(header("CamelFileName"), someMessageIdRepository)
    .to("file:data/outbox");
但在的文档中,我看到我们还可以指定一个IDIMPONT处理器,如下所示:

from("file://inbox?idempotent=true&idempotentRepository=#messageIdRepo")
    .to("file:data/outbox");
from("file:data/inbox?noop=true")
    .idempotentConsumer(header("CamelFileName"), someMessageIdRepository)
    .to("file:data/outbox");

这两种创建幂等消费者的方法之间是否存在显著的行为差异?

我不认为这两种方法之间存在显著的行为差异,除非您可以通过使用幂等消费者声明更多选项

我不认为这两种方法之间存在显著的行为差异,除了可以使用幂等消费者声明更多选项之外,还有一个区别:第一个选项在读取文件之前执行,第二个在读取文件之后执行。这一点非常重要,尤其是从FTP使用者下载大文件时。

有一个区别:第一个在读取文件之前执行,第二个在读取文件之后执行。这一点非常重要,尤其是从FTP使用者下载大型文件时