- Author: Chris Schankula, SĂ©bastien Mosser
- Version: 2023.09
DRAFT
- Learn how to set up RabbitMQ
- Use RabbitMQ's built-in web interface to send a message to a basic application
- Learn how to send a message from within a Spring service
- Learn how to transfer complex objects through a RabbitMQ queue
- Use RabbitMQ to communicate with multiple clients
For this lab, you need to:
- Click on "Use this template" to create your own repository from this template
- Click the green "Code" button on the resulting repo, and create a Codespace
- Wait for the Codespace to be created. This may take about 5 minutes to complete the first time. I recommend you do this before the lab!
- Remember to commit and push your code at the end of the lab! I recommend pushing even more often than that.
- Once you're done the lab, and you've committed all changes, delete the Codespace from your codespaces page, to save your gb-months of storage space. You can recreate the Codespace at any point. If you have registered for the student plan, you get 20 gb-months of space per month, so in general, you are safe as long as the sum of the size of all your stored Codespaces at any given moment is under 20gb.
-
Inside your Codespace, start the RabbitMQ service using
sudo service rabbitmq-server start
. -
Click "Ports", and open the RabbitMQ service running on port 15672 by clicking the globe icon that comes up when you mouse over the service.
-
Write a service (spring?) that listen to a channel and print the received message on stdout
-
Send a message to that channel using the Rabbit MQ web interface
-
Write a client code that sends a message to the previous channel
-
use it to read a message from stdin and send it to the other system that'll print it out on the other side.
- Update your sender and receiver so that they exchange JSON data structures
- Leverage rabbitMQ capacity to have multiple workers listening to the same channel