Skip to content

Commit

Permalink
Fix SqsWorker error messages (#2991)
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
  • Loading branch information
kkondaka and Krishna Kondaka authored Jul 7, 2023
1 parent cc5ed41 commit 45b6e55
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ private Optional<DeleteMessageBatchRequestEntry> processS3Object(
}

private void deleteSqsMessages(final List<DeleteMessageBatchRequestEntry> deleteMessageBatchRequestEntryCollection) {
if (deleteMessageBatchRequestEntryCollection.size() == 0) {
return;
}
final DeleteMessageBatchRequest deleteMessageBatchRequest = buildDeleteMessageBatchRequest(deleteMessageBatchRequestEntryCollection);
try {
final DeleteMessageBatchResponse deleteMessageBatchResponse = sqsClient.deleteMessageBatch(deleteMessageBatchRequest);
Expand All @@ -288,7 +291,7 @@ private void deleteSqsMessages(final List<DeleteMessageBatchRequestEntry> delete

if(LOG.isErrorEnabled()) {
final String failedMessages = deleteMessageBatchResponse.failed().stream()
.map(failed -> toString())
.map(failed -> failed.toString())
.collect(Collectors.joining(", "));
LOG.error("Failed to delete {} messages from SQS with errors: [{}].", failedDeleteCount, failedMessages);
}
Expand Down

0 comments on commit 45b6e55

Please sign in to comment.