Example Python App Consuming and Producing messages to AWS SQS
Follow the instructions below to configure your local machine to run and develop this example Python application.
Note: The instructions are focused on MacOsx however other environments will be supported with a bit of googling.
The example code relies on a running SQS service, the repo contains a Docker compose file that will spin up a configured SQS using Localstack.
-
Install Docker Toolbox - Instructions
-
Run the docker environment
docker-compose up
This will launch a SQS service listening on port 4576
- Python 3
$ brew install python3
- Virtual Env
$ sudo pip3 install virtualenv
From the terminal enable & configure the application dependencies.
$ virtualenv env
$ source env/bin/activate
(env) $ pip3 install -r requirements.txt
You can now run the application
(env) $ python3 sqs-example
To leave the virtual Environment
(env) $ deactivate