如何清理用于幂等 spring 集成模式的元数据存储 [英] How to cleanup the metadata store used for idempotent spring integration pattern
问题描述
我在 Spring 集成流程中使用幂等接收器模式来检测重复消息.
I am using the idempotent receiver pattern in my spring integration flow to detect duplicate messages.
上面的链接说
幂等条目的值可能是某个到期日期,之后某些人应该从元数据存储中删除该条目预定收割者.
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 表?
Is there any utility/scheduler available that is provided by spring to clean up the INT_METADATA_STORE table ?
推荐答案
嗯,没有这样的内置工具用于 MetadaStore
清理,虽然我认为我们需要补充:那就是当我们收到能够删除(或过期)商店中一些旧条目的请求时,这已经不是第一次了.请随意就此事提出 JIRA.看起来我们需要添加一些额外的列:UPDATE_DATE
以便能够将其与 expireUnusedOlderThan(long age)
回调中的某个时间进行比较.类似于我们对 ExpirableLockRegistry
的处理.
Well, there is no such a built-in tool for the MetadaStore
clean up, although I believe we need to add: that's not a first time when we get a request to be able to delete (or expire) some old entries in the store. Feel free to raise a JIRA on the matter. Looks like we need to add some extra column: UPDATE_DATE
to be able to compare it with some time from the expireUnusedOlderThan(long age)
callback. Something similar what we have with the ExpirableLockRegistry
.
既然你谈到了一个 INT_METADATA_STORE
表,我相信你可以暂时使用一个普通的 JdbcTemplate
和 Spring 框架中的一些计划任务:https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling-annotation-support
Since you talk about an INT_METADATA_STORE
table, I believe you can use for time being a plain JdbcTemplate
and some scheduled task from the Spring Framework: https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling-annotation-support
这篇关于如何清理用于幂等 spring 集成模式的元数据存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!