- Create Docker network:
make docker.network
- Run Docker container with RabbitMQ:
make docker.rabbitmq
- Wait 2-3 minutes for the RabbitMQ container to be ready to use.
- Run Docker container with worker:
make docker.worker
- Start Fiber API server (on another console):
make run
- Go to 127.0.0.1:3000/send?msg=Hello! and see received message on worker's console, like this:
2021/03/27 16:32:35 Successfully connected to RabbitMQ instance
2021/03/27 16:32:35 [*] - Waiting for messages
2021/03/27 16:32:35 [*] - Run Fiber API server and go to http://127.0.0.1:3000/send?msg=<YOUR TEXT HERE>
2021/03/27 16:33:24 Received message: Hello!
- Also, you can see useful RabbitMQ dashboard at localhost:15672: