[
https://issues.apache.org/jira/browse/CAMEL-24491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108746#comment-18108746
]
Andrea Cosentino commented on CAMEL-24491:
------------------------------------------
Fixed via [PR #25783|https://github.com/apache/camel/pull/25783].
_Claude Code on behalf of oscerd_
> camel-ibm-cos: consumer in-progress deduplication is inert, causing duplicate
> delivery
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-24491
> URL: https://issues.apache.org/jira/browse/CAMEL-24491
> Project: Camel
> Issue Type: Bug
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.22.1, 4.23.0, 4.18.5
>
>
> IBMCOSConsumer is meant to skip objects already being processed, via the
> endpoint's in-progress IdempotentRepository, but the deduplication never
> works:
> 1. createExchanges() only CHECKS the repository
> (getInProgressRepository().contains(key)) and never ADDS the key, so
> contains() is always false and every polled object is (re-)delivered —
> including objects still being processed by an overlapping poll when
> deleteAfterRead/moveAfterRead is off (at-least-once turns into duplicate
> delivery).
> 2. The repository is a MemoryIdempotentRepository service, but
> IBMCOSEndpoint.doStart() only starts 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 the repository is never
> started.
> 3. processCommit()/processRollback() never remove the key from the repository.
> Fix (mirroring camel-aws2-s3 AWS2S3Consumer, which this module was copied
> from): use getInProgressRepository().add(key) as the atomic guard (skip when
> it returns false), remove the key in processCommit (finally) and
> processRollback, and start the in-progress repository before the early
> returns in doStart().
> Affected: components/camel-ibm/camel-ibm-cos
> (org.apache.camel.component.ibm.cos.IBMCOSConsumer, IBMCOSEndpoint).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)