oscerd commented on code in PR #25740:
URL: https://github.com/apache/camel/pull/25740#discussion_r3860431688


##########
components/camel-ibm/camel-ibm-cos/src/main/java/org/apache/camel/component/ibm/cos/IBMCOSConsumer.java:
##########
@@ -160,7 +160,7 @@ protected Queue<Exchange> 
createExchanges(List<S3ObjectSummary> s3ObjectSummarie
             }
 
             if (getEndpoint().getInProgressRepository() != null
-                    && 
getEndpoint().getInProgressRepository().contains(s3ObjectSummary.getKey())) {
+                    && 
!getEndpoint().getInProgressRepository().add(s3ObjectSummary.getKey())) {

Review Comment:
   Good catch, thanks — you're right that `AWS2S3Consumer` guards this and my 
first version didn't. Fixed in 044a73c: the `getObject`/`createExchange` call 
is now wrapped so that if it throws after `add(key)` has claimed the 
in-progress key, the key is released (via `removeInProgress`) and the object is 
skipped for this poll, so it's retried next poll instead of being left 
permanently unconsumable. I went with the continue-the-batch shape (log + 
release + skip) rather than rethrow, so a transient failure on one object 
doesn't abandon the whole batch and the already-staged exchanges still get 
processed (their keys removed via their Synchronization).
   
   _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