This project is an example of event-driven architecture using SQS/SNS and RabbitMQ.
To install the project dependencies, run:
npm installTo configure LocalStack using a Docker image, follow the steps below:
- Download LocalStack Desktop on microsoft store
- Create account to free user
- Launch a new LocalStack Container inside LocalStack Desktop
- Access container created, and create SQS and SNS services
- Configure SNS subscription to your SQS
- Done
#Todo docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-managementThe exchange and queues are created on code, only need to have a local rabbitMQ running.
#publisher and receiver type
RECEIVER_TYPE=rabbitmq
PUBLISHER_TYPE=rabbitmq
#rabbitmq config
RABBITMQ_URL=amqp://localhost
QUEUE_NAME=order-queue
EXCHANGE_NAME=orders
ROUTING_KEY=""
#aws config
ACCESS_KEY_ID=""
SECRET_ACCESS_KEY=""
SESSION_TOKEN=""
REGION="us-east-1"
#sns config
TOPIC_ARN="arn:aws:sns:us-east-1:000000000000:ORDERS-CREATED"
#sqs config
QUEUE_URL="http://localhost.localstack.cloud:4566/000000000000/orders-process"
To start the application, run:
npm run start- Generate Documentation:
npm run docs- Start the Application:
npm run start- Node.js
- Express
- TypeScript
- AWS SDK
- RabbitMQ
- Docker
- Pino (for logging)