Open2

ローカルでSQSの動作を試す

ふじしろふじしろ

docker-compose.ymlのserviceにElasticMQの記述を追加

services:
  elasticmq:
    image: softwaremill/elasticmq
    ports:
      - "9324:9324"
      - "9325:9325"
    volumes:
      - type: bind
        source: ./custom.conf
        target: /opt/elasticmq.conf

上記のsourceとして指定しているsuctom.confを作成。
ファイルの中身は以下。

queues {
  queue1 {
    defaultVisibilityTimeout = 10 seconds
    delay = 5 seconds
    receiveMessageWait = 0 seconds
    deadLettersQueue {
      name = "queue1-dead-letters"
      maxReceiveCount = 3 // from 1 to 1000
    }
    fifo = false
    contentBasedDeduplication = false
    copyTo = "audit-queue-name"
    moveTo = "redirect-queue-name"
    tags {
      tag1 = "tagged1"
      tag2 = "tagged2"
    }
  }
  queue1-dead-letters { }
  audit-queue-name { }
  redirect-queue-name { }
}