How to cleanup the metadata store used for idempotent spring integration pattern
我在 Spring 集成流程中使用幂等接收器模式来检测重复消息。
https://docs.spring.io/spring-integration/docs/5.0.5.RELEASE/reference/html/system-management-chapter.html#metadata-store
在上面的链接中它说
The value of the idempotent entry may be some expiration date, after
which that entry should be removed from Metadata Store by some
scheduled reaper.
spring 是否提供了任何实用程序/调度程序来清理 INT_METADATA_STORE 表?
好吧,没有这样的内置工具用于 MetadaStore 清理,尽管我相信我们需要补充:这不是我们第一次收到能够删除(或expire) 商店中的一些旧条目。随意就此事提出 JIRA。看起来我们需要添加一些额外的列: UPDATE_DATE 以便能够将它与 expireUnusedOlderThan(long age) 回调中的一些时间进行比较。类似于我们使用 ExpirableLockRegistry.
的东西
既然你谈到了一个 INT_METADATA_STORE 表,我相信你可以暂时使用一个普通的 JdbcTemplate 和一些来自 Spring Framework 的计划任务:https://docs.spring.io/spring/docs/current /spring-framework-reference/integration.html#scheduling-annotation-support
- 谢谢会提高 Jira,我将 jms_messageId 标头值存储在 METADATA_KEY 中
来源:https://www.codenong.com/51839414/