0

Suppose I want to bulk-send three messages, A, B, C, in that order, to a FIFO SQS queue. I could use the bulk SendMessageBatch call.

We provide the ordered list [A,B,C] to the API call.

Suppose that the sends of A and C return HTTPCode 200, but B does not.

Because C was sent (and delivered) after B was sent (and not delivered), what happens? Does C still get enqueued? If I resend B, or re-issue the bulk send command within the visibility timeout period; and suppose all three messages succeed this time; will the queue read A, C, B?

I am using boto3 as my driver.

More detail from the docs:

You can use SendMessageBatch to send up to 10 messages to the specified queue by assigning either identical or different values to each message (or by not assigning values at all). This is a batch version of SendMessage. For a FIFO queue, multiple messages within a single batch are enqueued in the order they are sent.

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.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
socrates
  • 327
  • 2
  • 11
  • I think for FIFO queues it cannot happen that only B fails. If B fails C must not be enqueued either. – luk2302 Jan 24 '23 at 18:28
  • @luk2302 thank you. unfortunately i don't really know how to test this without simulating some weird network trickery... – socrates Jan 24 '23 at 20:43
  • Not even then are you able to test it, you only send the batch, something internal in SQS needs break for a batch to fail processing. Can't be of more help here unfortunately. – luk2302 Jan 25 '23 at 00:00
  • >something internal in SQS needs break for a batch to fail processing ok, that's more reassuring, then. thank you for the clarification. – socrates Jan 25 '23 at 21:53

0 Answers0