AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Send messages to SQS during Localstack initialization

The Docker containers have disposable nature. Personally, when using SQS on a Docker container locally for tests I don’t like to send messages to SQS each time container is initialized. In this tutorial, I will show how to initialize SQS with messages in it.

Ivan Polovyi
AWS in Plain English
2 min readMar 9, 2022

--

The complete source code can be found below

For convenience to spin up a container with SQS docker-compose is used. The definition file:

The definition file is very simple it uses a Localstack image to spin a container with SQS service in it. It also defines volumes. One for the bash script and another for files with messages. Each time container is created and all services of a Localstack are ready all scripts inside the first volume are executed. More about this can be found below:

The first volume has one bash script:

This script creates a profile that is used in the following commands, creates SQS, puts a single message to a queue, puts a single message to a queue from a file, located in the second volume, puts two (can be more) messages to a queue in batch…

--

--

Published in AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

Written by Ivan Polovyi

I am a Java Developer | OCA Java EE 8 | Spring Professional | AWS CDA | CKA | DCA | Oracle DB CA. I started programming at age 34 and still learning.

No responses yet

Write a response