AWS SQS FIFO Queue event source, is maximumBatchingWindowInSeconds supported?

Viewed 3026

Documentation says maximumBatchingWindowInSeconds is now supported and that:

For a FIFO queue the maximum is 10. For a batch size over 10, you must also set the MaximumBatchingWindowInSeconds parameter to at least 1 second.

However, I'm getting: "Invalid request provided: Batching window is not supported for FIFO queues" when trying to create an event source mapping.

So is it supported or not and if it is how do I enable it?

I need a FIFO Queue with a larger than 10 batch size.

I'm using AWS CDK to create the resource stack. My EventSourceMapping looks like this:

const cfnEventSourceMapping = new CfnEventSourceMapping(this, 'Auth0ImportQEventSourceMapping', {
  batchSize: 10,
  enabled: true,
  eventSourceArn: auth0ImportQ.queueArn,
  functionName: auth0ImportLambda.functionName,
  maximumBatchingWindowInSeconds: 10,
});
3 Answers

It is worded a little confusingly but MaximumBatchingWindowInSeconds is not compatible with FIFO queues.

FIFO max batch size is 10 and the sentence that references the MaximumBatchingWindowInSeconds setting talks about batch sizes >10 which do not apply to FIFO queues.

Just remove the MaximumBatchingWindowInSeconds and it should work.

MaximumBatchingWindowInSeconds applies only to Standard queues (not FIFO):

(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.

So do not set this parameter. Also you will need to ensure that Default visibility timeout for your fifo queue is larger then lambda timeout.

AWS documentation https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html clearly states that parameter MaximumBatchingWindowInSeconds can only be used for standard queues. And FIFO is not a standard Queues.

Batch window – Specify the maximum amount of time to gather records before invoking the function, in seconds. Only applicable to standard queues.

Related