docker.recipes

ElasticMQ (SQS Local)

beginner

Local Amazon SQS compatible queue.

Overview

ElasticMQ is an open-source message queue service developed by SoftwareMill that provides full compatibility with Amazon SQS (Simple Queue Service) API. Written in Scala and built on Akka, ElasticMQ offers developers a lightweight, in-memory message queuing solution for local development, testing, and integration scenarios without requiring AWS credentials or internet connectivity. The service implements the complete SQS REST API, supporting both standard and FIFO queues with features like message visibility timeouts, dead letter queues, and message attributes. This Docker deployment creates a local SQS-compatible environment that mirrors AWS SQS behavior while running entirely on your infrastructure. ElasticMQ exposes both the standard SQS API endpoint on port 9324 and a web-based management interface on port 9325, enabling developers to interact with queues programmatically through AWS SDKs or visually through the browser interface. The setup eliminates AWS dependencies during development while maintaining complete API compatibility for production deployments. Development teams working with microservices architectures, event-driven systems, or applications requiring message queuing capabilities will find ElasticMQ invaluable for offline development and continuous integration pipelines. Organizations seeking to reduce cloud costs during development phases or those requiring air-gapped development environments can leverage this stack to maintain SQS compatibility without external dependencies. The combination proves particularly useful for integration testing, where reliable queue behavior must be validated before deploying to AWS production environments.

Key Features

  • Complete Amazon SQS API compatibility with support for all standard SQS operations
  • Built-in web UI for queue management, message inspection, and monitoring at port 9325
  • Support for both standard queues and FIFO queues with message ordering guarantees
  • Message visibility timeout configuration with automatic message redelivery
  • Dead letter queue support for handling failed message processing scenarios
  • Message attributes and custom metadata handling identical to AWS SQS behavior
  • In-memory storage with optional persistence configuration through elasticmq.conf
  • AWS SDK integration using custom endpoint configuration without code changes

Common Use Cases

  • 1Local development environment for AWS SQS-dependent applications without cloud connectivity
  • 2Continuous integration testing pipelines requiring reliable message queue behavior
  • 3Microservices development where services communicate through message queues
  • 4Event-driven architecture prototyping and validation before cloud deployment
  • 5Integration testing for applications processing SQS messages with predictable queue states
  • 6Cost reduction during development phases by eliminating AWS SQS charges
  • 7Air-gapped or security-restricted environments requiring message queuing capabilities

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration
  • Available ports 9324 (SQS API) and 9325 (Web UI) on the host system
  • Minimum 512MB RAM allocation for ElasticMQ container operations
  • Basic understanding of Amazon SQS concepts and message queue patterns
  • AWS SDK knowledge for programmatic queue interaction and configuration
  • Network connectivity planning if integrating with other containerized services

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 elasticmq:
3 image: softwaremill/elasticmq:latest
4 container_name: elasticmq
5 restart: unless-stopped
6 ports:
7 - "9324:9324"
8 - "9325:9325"

.env Template

.env
1# No additional config needed

Usage Notes

  1. 1Docs: https://github.com/softwaremill/elasticmq
  2. 2SQS API at http://localhost:9324, web UI at http://localhost:9325
  3. 3AWS SDK: endpoint_url='http://localhost:9324', region='elasticmq'
  4. 4Create queues via API or elasticmq.conf file
  5. 5Supports standard and FIFO queues, visibility timeout, dead-letter
  6. 6In-memory by default - configure for persistence if needed

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 elasticmq:
5 image: softwaremill/elasticmq:latest
6 container_name: elasticmq
7 restart: unless-stopped
8 ports:
9 - "9324:9324"
10 - "9325:9325"
11EOF
12
13# 2. Create the .env file
14cat > .env << 'EOF'
15# No additional config needed
16EOF
17
18# 3. Start the services
19docker compose up -d
20
21# 4. View logs
22docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/sqs-local/run | bash

Troubleshooting

  • Connection refused on port 9324: Verify container is running and port mapping is correct in docker-compose.yml
  • Web UI not accessible on port 9325: Check firewall settings and ensure both ports are properly exposed
  • AWS SDK connection errors: Set endpoint_url to 'http://localhost:9324' and region to 'elasticmq' in SDK configuration
  • Messages not persisting after container restart: Configure elasticmq.conf with file-based storage instead of default in-memory
  • Queue creation failures: Ensure queue names follow SQS naming conventions and check ElasticMQ logs for validation errors
  • FIFO queue issues: Verify MessageGroupId and MessageDeduplicationId are provided for FIFO queue operations

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space