oscerd opened a new pull request, #25740:
URL: https://github.com/apache/camel/pull/25740

   # CAMEL-24491: make the IBM COS consumer's in-progress deduplication 
effective
   
   The IBM COS consumer is meant to skip objects that are already being 
processed, via the endpoint's in-progress `IdempotentRepository`, but the 
deduplication never worked:
   
   1. `createExchanges()` only **checked** the repository 
(`getInProgressRepository().contains(key)`) and never **added** the key, so 
`contains()` was always false.
   2. The repository is a `MemoryIdempotentRepository` service, but 
`IBMCOSEndpoint.doStart()` only started it (`ServiceHelper.startService`) 
**after** two early returns — when a `fileName` is configured, or when the 
bucket already exists (the normal consuming case). So in practice it was never 
started.
   3. `processCommit()` / `processRollback()` never removed the key.
   
   Together these meant overlapping polls could re-deliver an object still 
being processed when `deleteAfterRead`/`moveAfterRead` were off.
   
   ## Fix
   
   Mirror `camel-aws2-s3`'s `AWS2S3Consumer` (this module was copied from it):
   - Use `getInProgressRepository().add(key)` as the atomic guard (skip the 
object when `add` returns `false`, i.e. it is already in progress).
   - Remove the key in `processCommit` (in a `finally`) and `processRollback`, 
via a null-safe `removeInProgress` helper.
   - Start the in-progress repository up front in `doStart()`, before any early 
return.
   
   ## Testing
   
   The module ships only integration tests (they require live IBM COS 
credentials) and has no mocking dependency, so this lifecycle fix is not 
unit-testable without adding new test dependencies. It ports the behavior of 
the reviewed `camel-aws2-s3` consumer. Verified with a module build (`BUILD 
SUCCESS`, no generated-file drift).
   
   ---
   _Claude Code on behalf of oscerd_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to