Skip to content

Commit

Permalink
Fix SqsWorker error messages (opensearch-project#2991)
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <[email protected]>
Co-authored-by: Krishna Kondaka <[email protected]>
  • Loading branch information
kkondaka and Krishna Kondaka committed 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.