Skip to content

SQS batchSize is not limited to 10 when using maxBatchingWindow #208

Closed
@gfaramaz

Description

Start from the Use-case

Lift version: 1.17.0

I'm writing an SQS construct for batch processing a lot a message every 3 minutes or 1000 events

constructs: {
    'event-queue': {
      type: 'queue',
      batchSize: 1000,
      maxBatchingWindow: 180,
      worker: {
        handler: 'src/handler.receiver',
        memorySize: 256,
        reservedConcurrency: 1,
      },
    },
  },

On deploy I have an error

Warning: Invalid configuration encountered
  at 'constructs.event-queue': unsupported number format

It's because batch size is limited to 10 which isn't true anymore in AWS since end of 2020 when having the maxBatchingWindow option.

As a workaround I specify it manually in serverless extensions

resources: {
    extensions: {
      <EventSourceMappingLogicalIdFromCloudFormation>: {
        Properties: {
          BatchSize: 1000,
        },
      },
    },
}

Example Config

No response

Implementation Idea

No response

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions