Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serverless-offline-sqs] Doesn't trigger lambda when new message is added to elasticMQ #255

Open
10Bude10 opened this issue Sep 8, 2023 · 0 comments

Comments

@10Bude10
Copy link

10Bude10 commented Sep 8, 2023

Expect:
When a new message is added to elasticMQ my responsible lambda is triggered for handling the message

Current behaviour:
Lambda sends messages to local SQS queue. The running elasticMQ displays received messages. The responsible lambda to handle SQS messages isn't triggered.

Setup:
package.json

"@aws-sdk/client-sqs": "^3.354.0",
"serverless-esbuild": "^1.46.0",
"serverless-offline": "^12.0.4",
"serverless-offline-sqs": "^7.3.2",

serverless.yml

serverless-offline-sqs:
    autoCreate: false
    endpoint: http://localhost:9324
    region: ${self:provider.region}
    accessKeyId: root
    secretAccessKey: root
    skipCacheInvalidation: false
    apiVersion: '2012-11-05'

plugins:
  - serverless-esbuild
  - serverless-offline
  - serverless-offline-sqs

functions:
  addIndustryData:
      handler: src/handler/industry/handler.addIndustryData
      events:
        - sqs:
            arn:
              Ref: fetchIndustryDataQueue

resources:
  Resources:
    fetchIndustryDataQueue:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: fetchIndustryDataQueue

custom.conf (for elasticMQ)

include classpath("application.conf")
queues {
  fetchIndustryDataQueue {
    defaultVisibilityTimeout = 30 seconds
    delay = 0 seconds
    receiveMessageWait = 0 seconds
  }
}
# Region and accountId which will be included in resource ids
aws {
  region = eu-central-1
  accountId = root
}

Any ideas, what's the problem that the lambda isn't triggered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant