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


##########
components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java:
##########
@@ -315,9 +336,38 @@ protected Queue<Exchange> createExchanges(List<S3Object> 
s3ObjectSummaries) {
             throw e;
         }
 
+        if (!failures.isEmpty()) {
+            if (!anyGot) {
+                // none of the listed objects could be got, so this is not 
about one object (expired credentials, no
+                // permission to get, throttling, no connection): the poll 
fails as it does when the listing fails, and
+                // the error handling and the backoff of the scheduled 
consumer apply
+                Map.Entry<String, RuntimeException> first = 
failures.entrySet().iterator().next();
+                LOG.warn("None of the listed objects of bucket {} could be got 
({} failed, the first is {}): the poll fails",
+                        getConfiguration().getBucketName(), failures.size(), 
first.getKey());
+                throw first.getValue();
+            }
+            // as processCommit does: the consumer goes on, and a custom 
exception handler or bridgeErrorHandler sees
+            // the failure
+            for (Map.Entry<String, RuntimeException> failure : 
failures.entrySet()) {
+                String message = "Error getting S3Object " + failure.getKey() 
+ " from bucket "
+                                 + getConfiguration().getBucketName()
+                                 + ". The object is skipped for this poll. 
This exception is ignored.";

Review Comment:
   Changed in df045ca8593b. The message given to the exception handler for a 
skipped object is now
   `Error getting S3Object <key> from bucket <bucket>. The object is skipped 
for this poll.`, without
   "This exception is ignored.". That is true in all three cases (default 
`LoggingExceptionHandler`,
   `bridgeErrorHandler=true`, custom `exceptionHandler`). The upgrade-guide 
note no longer calls it an ignored exception
   either. I left the `processCommit` message as it is, since it is not part of 
this change. No test asserts the
   sentence; camel-aws2-s3 unit tests: 104 tests, 0 failures.
   
   _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