Skip to content

Using a local mock SQS server

Maciej Mensfeld edited this page Mar 30, 2026 · 10 revisions

Using a Local Mock SQS Server

Configure Shoryuken to use a local SQS-compatible server for development and testing without connecting to AWS.

ElasticMQ is a lightweight, open-source, in-memory SQS-compatible server. It is used in Shoryuken's own CI. It supports standard queues, FIFO queues, dead-letter queues, message attributes, batch operations, visibility timeout, and long polling. The softwaremill/elasticmq-native image is ~30MB and starts in milliseconds.

Run ElasticMQ

The easiest way to run ElasticMQ is with Docker:

docker run -p 9324:9324 softwaremill/elasticmq-native

Or with Docker Compose:

# docker-compose.yml
services:
  elasticmq:
    image: softwaremill/elasticmq-native:latest
    ports:
      - "9324:9324"
docker compose up -d

Configure Shoryuken to use ElasticMQ

Configure Client

Shoryuken.configure_client do |config|
  config.sqs_client = Aws::SQS::Client.new(
    region: 'us-east-1',
    access_key_id: 'fake',
    secret_access_key: 'fake',
    endpoint: 'http://localhost:9324'
  )
end

Configure Server

Shoryuken.configure_server do |config|
  config.sqs_client = Aws::SQS::Client.new(
    region: 'us-east-1',
    access_key_id: 'fake',
    secret_access_key: 'fake',
    endpoint: 'http://localhost:9324'
  )
end

Running SQS commands locally

If you want to use shoryuken sqs command with a different endpoint you can pass an --endpoint option to the command, example:

shoryuken sqs ls --endpoint=http://localhost:9324

if you don't want to pass the --endpoint option to all sqs commands you can set an env var for it in the application SHORYUKEN_SQS_ENDPOINT=http://localhost:9324.

Advanced Configuration

ElasticMQ can be configured with a custom.conf file for pre-created queues, FIFO queues, dead-letter queue redrive policies, and more. See the ElasticMQ documentation for details.

Clone this wiki locally