Skip to content

Minimal example of running serverless offline with SQS plugin using multipe docker containers. Handling of API Gateway and SQS events.

Notifications You must be signed in to change notification settings

christian-eriksson/serverless-offline-sqs-docker-example

Repository files navigation

Minimal example using ElastiMQ between docker containers in a simple TypeScript project. It creates two docker containers, one running SQS (ElasticMQ) and one with a Serverless project.

One queue is created TestQueue in the SQS container. The Serverless container provides a API Gateway handler with the following endpoint http://localhost:3000/echo which takes a query parameter QueueMessage. Sending a message to the endpoint adds a message to the SQS queue and a handler in Serverless will take care of the resulting SQS event and pring the message to console.

Getting started

docker-compose build
docker-compose up

Use postman (or something equivalent) to send a HTTP request:

GET http://localhost:3000/echo?QueueMessage=<Some message>

The setup of queues is very much inspired by the example provided by Arthur (godu) Weber

About

Minimal example of running serverless offline with SQS plugin using multipe docker containers. Handling of API Gateway and SQS events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published