Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6724

PutSQS does not check for individual status in batch message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.9.2
    • 1.11.0
    • Extensions
    • Docker running in AWS

    Description

      PutSQS does not check for individual status in batch message. This could lead to PutSQS reporting success and dropping files even when individual files actually failed in SQS. 

      As specified in the AWSSimpleQueueService API Reference for SendMessageBatch:

      The result of sending each message is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

       

      We learned this as we did not Base64-encode compressed files (gzip) before sending them to PutSQS. All the compressed files failed to queue in SQS, but SQS acknowledged the batch message and reported status 200 (success). Thus PutSQS also reported success and dropped the files, when they actually failed. 

      I suggest a simple fix by implementing SendMessageBatchResult to check status on individual files by implementing something similar to this

      SendMessageBatchResult sendMessageBatchResult = sqsClient.sendMessageBatch(request);
                      if (!sendMessageBatchResult.getFailed().isEmpty()) {
                          // Error
                      }
      

      Attachments

        Issue Links

          Activity

            People

              pvillard Pierre Villard
              O Martin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Time Spent - 0.5h Remaining Estimate - 1.5h
                  1.5h
                  Logged:
                  Time Spent - 0.5h Remaining Estimate - 1.5h
                  0.5h