CAMEL-23220: Added support for idempotent consumption in the camel-at…#22114
CAMEL-23220: Added support for idempotent consumption in the camel-at…#22114MimerPlusPlus wants to merge 2 commits intoapache:mainfrom
Conversation
…om component. The fix support idempotency with a plugable strategy for recognizing already seen atom entries. Them component defaults to idempotent consumption, as it did in versions up to 3.16.
gnodet
left a comment
There was a problem hiding this comment.
Review — Claude Code on behalf of Guillaume Nodet
Verdict: REQUEST CHANGES
Good feature idea, but there are design issues that should be addressed before merging.
1. Thread safety in ItemUpdatedIdempotentStrategy (Medium)
The contains() + add() pattern is not atomic. If multiple threads process entries concurrently, two threads could both pass contains() for the same key and both process the entry.
Fix: Use IdempotentRepository.add() directly — it returns boolean indicating whether the entry was new, and is typically atomic. Avoid the check-then-act pattern.
2. Hardcoded MemoryIdempotentRepository (Medium)
The consumer always creates a new MemoryIdempotentRepository. Users cannot provide their own IdempotentRepository (e.g., FileIdempotentRepository or JpaMessageIdRepository for persistence across restarts).
Fix: Add a @UriParam for idempotentRepository on the endpoint, defaulting to MemoryIdempotentRepository if not set. This follows the same pattern used by camel-file and other components.
3. Unclear @UriParam description (Low)
idempotentConsume says "Enable idempotent consumption to skip already processed entries" but doesn't clarify what the idempotent key is (entry ID? updated date?). Recommend clarifying.
4. Missing documentation (Low)
The new option should have a brief mention in src/main/docs/atom-component.adoc explaining the feature behavior.
5. No JIRA issue (Low)
Convention is CAMEL-XXXX: ... in commit messages.
-- Claude Code on behalf of Guillaume Nodet |
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
Hi @MimerPlusPlus there are the following uncommitted changes I'd recommend to cd into catalog and dsl, and |
Camel-atom component.
The fix support idempotency with a plugable strategy for recognizing already seen atom entries. Them component defaults to idempotent consumption, as it did in versions up to 3.16.
It is a proposed fix for CAMEL-23220.
The functionality has been discussed on Zulip chat: #camel > Camel-atom no longer only send entries only once
Description
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.