问题
I am using the idempotent receiver pattern in my spring integration flow to detect duplicate messages.
https://docs.spring.io/spring-integration/docs/5.0.5.RELEASE/reference/html/system-management-chapter.html#metadata-store
In above link it says
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.
Is there any utility/scheduler available that is provided by spring to clean up the INT_METADATA_STORE table ?
回答1:
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
.
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
来源:https://stackoverflow.com/questions/51839414/how-to-cleanup-the-metadata-store-used-for-idempotent-spring-integration-pattern