This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new bd8ca6af6be6 camel-aws2-sqs: log the failed entry, not the whole
batch, when extending a visibility window fails (#29948)
bd8ca6af6be6 is described below
commit bd8ca6af6be6ba13eff523c443ded79fc949dfec
Author: dhairya05 <[email protected]>
AuthorDate: Sun Nov 15 01:06:21 2026 +0530
camel-aws2-sqs: log the failed entry, not the whole batch, when extending a
visibility window fails (#29948)
…ding a visibility window fails
changeMessageVisibilityBatch reports its failures per entry, and the
consumer iterates them with br.failed().forEach(failedEntry -> ...), but
both log statements in the loop pass br.failed() - the whole list - so
the entry the iteration is about is never named and the complete list is
repeated once per failure.
The debug branch also passed that list with no {} in the message, which
SLF4J drops silently because the argument is not a Throwable, so the
invalid-handle case logged nothing but a bare sentence.
Log failedEntry (its toString carries the id, code and message), the way
the successful() loop right below already logs successEntry.id(), and
compare the code with the constant first so a reply without a code does
not throw.
---
.../java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
index 0c3f426dadef..567111b473c0 100644
---
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
+++
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
@@ -544,11 +544,10 @@ public class Sqs2Consumer extends
ScheduledBatchPollingConsumer {
=
getEndpoint().getClient().changeMessageVisibilityBatch(request);
if (br.hasFailed()) {
br.failed().forEach(failedEntry -> {
- if
(failedEntry.code().equals(RECEIPT_HANDLE_IS_INVALID)) {
- LOG.debug("Extended visibility window
for request entry failed with invalid handle.",
- br.failed());
+ if
(RECEIPT_HANDLE_IS_INVALID.equals(failedEntry.code())) {
+ LOG.debug("Visibility window not
extended for {}: invalid handle", failedEntry.id());
} else {
- LOG.warn("Extended visibility window
for request entry failed: {}", br.failed());
+ LOG.warn("Extended visibility window
for request entry failed: {}", failedEntry);
}
});
}