- Related course module: Distributed Systems
- Tutorial scope: DS Design and Implementation
- Technologies: Linux, Docker, RabbitMQ
During this lab, we will learn few things like:
- How to install and configure a communication broker
- Deploy the service using docker compose
- Explore different pub/sub design patterns to develop an event-based application
Note: In the following, you will see
Discoverif you should play around and see the documentation or test. You will seeActionif you should run a command, write a program, or something similar. You will seeQuestionwhen there is a question to provide an answer to.
- A functional linux environment
- A function Docker installation
- Github or Gitlab account
Check out these tutorials on how to get a Linux OS up and running:
Check out Lab0: Foundations 1 - Deployment of a Centralized App to learn more about installing docker and docker compose.
I recommend that you create a text file with your favorite editor where you will continuously copy the commands and their output to help you with your Lab report.
Discover
Explore the following documentation:
Action
- Create a docker compose file using
rabbitmq:management-alpineto deploy a RabbitMQ service - Include the docker-compose.yml content in your report
- Include the service startup logs in your report
- Connect to RabbitMQ management dashboard and explore it
Note: For the rest of this Lab we will use exclusively Pika Python Clients
This section uses code from this documentation.
Question
- What is a queue?
- What is the role of the send module?
- What is the role of the receive module?
Action
- Execute
sendandreceivemodules - Modify the
sendcode to send an new message each second (no time limit)
This section uses code from this documentation
Question
- What is an exchange?
- How many exchange types and which one is used?
- What is a binding?
- What is the role of the emit_log module?
- What is the role of the receive_log module?
Action
- Execute
receive_logandemit_logmodules - Explore the management dashboard to visualize the created resources
- Provide the list of created bindings
This section uses code from this documentation
Question
- What are the properties of a routing key?
- What are the available wildcards in RabbitMQ?
Action
- Execute
receive_logs_topicmodule using a binding key of your choice - Execute
emit_log_topicmodule using different binding keys including the previously selected one. Notice the behaviour of the application. - Explore the management dashboard to visualize the created resources
- Provide the list of created bindings
- Which concept should be used to deliver a task to exactly one worker ?
- Which concept should be used to deliver a message to multiple consumers?
- What is the difference between fanout and direct exchanges?
- Inability to route messages based on multiple criteria is a limitation of which exchange type?
- What is the solution to this limitation?
The END.
