allthingssecurity commented on code in PR #27645:
URL: https://github.com/apache/camel/pull/27645#discussion_r4236801264


##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java:
##########
@@ -279,31 +315,82 @@ public void onDone(Exchange exchange) {
                         });
                     }
                 } catch (Exception e) {
+                    if (isNoSuchKey(e)) {
+                        // deleted (for example by another consumer) after it 
was listed
+                        LOG.debug("Skipping object {} as it no longer exists", 
srcObjectName);
+                        inProgress.remove(srcObjectName);
+                        skipped++;
+                        continue;
+                    }
                     LOG.warn("Error getting MinioObject due: {}", 
e.getMessage());
+                    // this and the remaining exchanges of the batch are not 
processed
+                    releaseInProgress(srcObjectName, exchanges);
+                    if (ready != null) {
+                        routeExchange(ready, routed, total - skipped, false, 
0);
+                    }
                     throw e;
                 }
             }
 
-            // add on completion to handle after work when the exchange is done
-            exchange.getExchangeExtension().addOnCompletion(new 
Synchronization() {
-                public void onComplete(Exchange exchange) {
-                    processCommit(exchange);
+            if (ready != null) {
+                routeExchange(ready, routed++, total - skipped, false, 
exchanges.size() + 1);

Review Comment:
   The deferred-routing change (5a7bb335) was dropped per Claus's review 
(reverted in e33ee2069e), so the batch properties are set up front again and 
this code path is gone. The remaining inexactness (`CamelBatchSize` can be too 
high and possibly no exchange has `CamelBatchComplete=true` when an object is 
deleted between the listing and the get) is now documented in the component 
docs (bd2fa5fae3).
   
   _Claude Code on behalf of allthingssecurity_
   



-- 
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