maximumBatchingWindow not passed to AWS

I would like to specify the maximumBatchingWindow property for an SQS event. It is mentioned here in the docs, but it does not seem to work.

I am still on serverless v1, and my yaml contains something like this:

  messageProcessor:
    handler: com.me.MessageProcessor
    timeout: 60
    memorySize: 2048
    reservedConcurrency: 1
    events:
      - sqs: 
          batchSize: 20  # can be larger: total pay-load cannot exceed 6MB
          maximumBatchingWindow: 1 # cannot be zero
          arn: 
            Fn::GetAtt:
              - messagesQ
              - Arn

But when I try to apply these settings I get this error from AWS:

Invalid request provided: Maximum batch window in seconds must be greater than 0 if maximum batch size is greater than 10 (Service: Lambda, Status Code: 400, Request ID

Which leads me to believe that the setting is ignored.

Is there some workaround I can try, or will it work only after I upgrade to v2?

2 Likes

I don’t have the same problem, FWIW in the latest release. I was hitting the same error initially, but it was because I’d named the property maximumBatchWindow instead of maximumBatchingWindow

I guess the documentation should be correct.

your suggestion is also not working for me

Same thing for me, doesn’t seem to be working.

For me, it was not working for serverless V1.7. I updated the serverless to 2.23 and it started working.
for V1.7 it was not picking up batchSize and maximumBatchingWindow
For V2.23 its working now and changes are reflected in aws console

For me, it was not working for serverless V1.7. I updated the serverless to 2.23 and it started working.

It would be great if serverless team can specify what version of serverless support each functionality in documentation

1 Like