Skip to content

CAMEL-23220: Added support for idempotent consumption in the camel-at…#22114

Open
MimerPlusPlus wants to merge 2 commits intoapache:mainfrom
MimerPlusPlus:main
Open

CAMEL-23220: Added support for idempotent consumption in the camel-at…#22114
MimerPlusPlus wants to merge 2 commits intoapache:mainfrom
MimerPlusPlus:main

Conversation

@MimerPlusPlus
Copy link
Contributor

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

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

…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.
Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gnodet
Copy link
Contributor

gnodet commented Mar 20, 2026

Correction: My review incorrectly stated there was no JIRA issue. The commit title does reference CAMEL-23220. Apologies for the error — the remaining review points (thread safety, hardcoded repository, docs) still apply.

-- Claude Code on behalf of Guillaume Nodet

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@Croway
Copy link
Contributor

Croway commented Mar 23, 2026

Hi @MimerPlusPlus there are the following uncommitted changes

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/atom.json
	modified:   dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AtomEndpointBuilderFactory.java

I'd recommend to cd into catalog and dsl, and mvn clean install -DskipTests both project so that the code is generated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants