Skip to content

bug: SQS -> Lambda only trigger once a minute #11003

@muttonhead

Description

@muttonhead

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a setup of our application sending events to EventBridge -> SQS -> Lambda, with the SQS queue it only triggers the lambda with a single batch every minute even though it is backing up with messages. Removing the SQS queue and going straight to Lambda from EventBridge does not experience this. This happens both with a batch size of 1 or 10.

24-06-10T18:38:05.923  INFO --- [et.reactor-7] localstack.request.http    : POST /_localstack_lambda/3634a661eab2c29fe4b2c024611cca78/invocations/d4e0d313-a238-4d92-abc8-b29adbf4bae0/logs => 202
2024-06-10T18:38:05.942  INFO --- [et.reactor-0] localstack.request.http    : POST /_localstack_lambda/3634a661eab2c29fe4b2c024611cca78/invocations/d4e0d313-a238-4d92-abc8-b29adbf4bae0/response => 202
2024-06-10T18:39:07.003  INFO --- [et.reactor-3] localstack.request.http    : POST /_localstack_lambda/3634a661eab2c29fe4b2c024611cca78/invocations/689a93d9-4d1a-486d-a553-458a949c639e/logs => 202
2024-06-10T18:39:07.004  INFO --- [t.reactor-14] localstack.request.http    : POST /_localstack_lambda/3634a661eab2c29fe4b2c024611cca78/invocations/689a93d9-4d1a-486d-a553-458a949c639e/response => 202

Expected Behavior

I would expect the lambda to keep running with batches until the queue is empty and to run quickly, this same setup in AWS results in pretty instant Lambda invocations.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
    image: localstack/localstack-pro:latest
    ports:
      - "4566:4566"
      - "4510-4559:4510-4559"
      - "443:443"
    environment:
      # Activate LocalStack Pro: https://docs.localstack.cloud/getting-started/auth-token/
      - LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN}
      # LocalStack configuration: https://docs.localstack.cloud/references/configuration/
      - DEBUG=${DEBUG:-0}
      - PERSISTENCE=${PERSISTENCE:-1}
      - HOSTNAME_EXTERNAL=localhost.localstack.cloud
      - SQS_ENDPOINT_STRATEGY=off
      - SNAPSHOT_FLUSH_INTERVAL=600
      - SNAPSHOT_LOAD_STRATEGY=ON_STARTUP
      - DYNAMODB_HEAP_SIZE=2G
      - EVENT_RULE_ENGINE=java
    volumes:
      - localstack-data:/var/lib/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

  1. Create a SQS Queue
  2. Create a lambda that triggers on an SQS queue
  3. Create an EventBridge rule to match events and send to SQS
  4. Send a number of events that match greater than batch size

Environment

- OS: Ubuntu 22.04
- LocalStack:
  LocalStack version: 3.4.1.dev20240604121021
  LocalStack Docker image sha: d31bd406268c987da8ea05f8109187f8ef55d79f690fc3133f1076d71b5d053c
  LocalStack build date: 2024-06-04
  LocalStack build git hash: b08d646

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions