【问题标题】:Camel File component - whats the difference between a IdempotentRepository and a InProgressRepositoryCamel File 组件 - IdempotentRepository 和 InProgressRepository 之间有什么区别
【发布时间】:2020-11-16 16:08:07
【问题描述】:

IdempotentRepository 和 InProgressRepository 之间到底有什么区别? 我有来自the File component page 的以下定义:

  • IdempotentRepository:“选择使用 Idempotent Consumer EIP 模式让 Camel 跳过已处理的文件”
  • InProgressRepository:“正在进行的存储库用于说明当前正在使用的正在进行的文件。”

对我来说,这些定义相同,只是措辞略有不同。 它们还可以使用相同的幂等存储库。

所以我有点困惑,我需要两者吗?或者 idempotentRepository 是否足够好?

【问题讨论】:

    标签: file apache-camel idempotent


    【解决方案1】:

    在阅读以下信息之前,请确保您已阅读并理解idempotent 的概念。


    IdempotentRepository - 用于存储已处理文件的缓存的地方(即文件已被您的路由消费和处理)。在检查幂等特性时使用。

    InProgressRepository - 用于存储当前正在进行的文件(即当前批处理中要使用的文件)缓存的地方。始终用于文件使用者。

    IMO,通常需要 InProgressRepository 和默认设置(基于内存的存储库)。如果需要idempotent,则可能需要 IdempotentRepository,并选择自己的设置(file-basedJPA-based、...)以防止应用重启。

    【讨论】:

    • 解释得更好!但仍有一些问题:2 个文件组件是否会首先检查 InProgressRepository 以查看其他文件组件是否已经在使用该文件(当然只有当这是一个共享存储库时)?那么幂等 InProgressRepository 的目的是什么?
    • 永远不要更改 InProgressRepository 的设置,您可能需要自行测试或在互联网上搜索或询问其他帖子。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-05
    • 1970-01-01
    • 2011-04-16
    • 2015-03-21
    • 2019-07-10
    • 2013-07-12
    相关资源
    最近更新 更多