gnodet-bot commented on code in PR #27697:
URL: https://github.com/apache/camel/pull/27697#discussion_r4245846940
##########
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:
💡 **Minor / Convention:** `"This exception is ignored."` is the established
pattern (matching `processCommit`), and the author explicitly followed it. That
said, when `bridgeErrorHandler=true` or a custom `ExceptionHandler` is wired,
the exception is actually **routed** — not ignored. A more precise phrasing
like `"...handled by the configured exception handler."` would avoid operator
confusion, but changing it deviates from the existing convention. Leaving to
author's judgment.
--
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]