Description
Gunnar Hillert opened INT-1941 and commented
While working with the Twitter adapter, I was playing around with starting + stopping the Twitter search using the Control Bus which worked great. In that regard I thought it would be a nice to demonstrate to also clear my local Tweet cache. This then let me to investigate the "SimpleMetadataStore" a bit closer.
Just for readers of this issue:
In order to prevent message duplication for various adapters (incl. Twitter) Spring Integration provides the concept of Metadata Stores for storing various types of metadata (org.springframework.integration.store.MetadataStore and org.springframework.integration.store.PropertiesPersistingMetadataStore)
It may be worthwhile to be able to make MetadataStores resettable (e.g. On a per component basis). E.g. the Twitter adapter stores the last Tweet Id in the store to prevent processing of Tweets with lower Id in order to prevent duplication. 2 issues - The map that backs MetaData stores is private and not easily extendable.
Also, the key used to store the Twitter "since_id"/"lastProcessedId" quite cryptic, e.g.: "twitter:search-inbound-channel-adapter.(inner bean).twitter-anonymous"
Lastly as an additional piece of information, I think the lastProcessedId is also cached within the Twitter adapter itself.
See also for reference: https://jira.springsource.org/browse/INT-1527
Affects: 2.0.4
Issue Links:
- MetadataStore Key is named '(inner bean)' [INT-3147] #7119 MetadataStore Key is named '(inner bean)'
("depends on") - Add a Redis-backed MetadataStore [INT-3085] #7067 Add a Redis-backed MetadataStore