Tags | rabbit-mq |
Hard Prerequisites | |
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content. | |
|
RabbitMQ, despite its funny name, is a seriously useful piece of software.
On top of this, it’s a great introduction to parallel computing.
Take a look at the offical tutorial here: https://www.rabbitmq.com/getstarted.html.
Create one repo. Inside that repo create 6 directories, name them: one
, two
, three
, etc.
Inside directory one, implement tutorial 1 from here: https://www.rabbitmq.com/getstarted.html. Inside directory 2 implement tutorial 2, etc. Go up to number 6.
Now pay close attention: Copy-pasting code is not sufficient.
Each of your tutorial implementations must be DRY in itself. For example, if you have the string ‘hello’ pasted all over the place then your code would not be DRY.
Hint: Here’s the expected file structure for the first tutorial:
one/
channel.py
recieve.py
send.py
Hard-coding the connection string is no good. You want to fetch it from an environmental variable. On top of that you want to be able to run your code successfully even if the environmental variable is not set.
For example:
python send.py # this should work as per the tutorials
export HOST="35:456:145:235"
python send.py # this should attempt to connect to a rabbitmq server at the given ip address