https://github.com/zemanlx/swarm-queue
https://github.com/zemanlx/swarm-queue
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zemanlx/swarm-queue
- Owner: zemanlx
- Created: 2018-01-26T08:44:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-29T13:18:28.000Z (over 8 years ago)
- Last Synced: 2025-02-05T12:28:58.663Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo of RabbitMQ on Docker
This repo is showing how RabbitMQ works. All is running in your docker so you
do not need to install anything but docker tools.
## Prerequisites
- Docker
- Docker Compose
## Run this Demo
1. Clone this repo
1. From repo folder run `docker-compose up`
1. Open rabbitmq [management](http://localhost:15672) interface (guest/guest)
## How it works
`ALL_CAPS` are environmet variables set in `docker-compose.yml` per each
_service_.
- `publisher` - posts one message to `QUEUE_SERVER` to `PUBLISHER_QUEUE_NAME`
every `TASK_FREQUENCY` seconds
- `job-phase-1` - consumes messages from `CONSUMER_QUEUE_NAME`, it takes
`TASK_DIFFICULTY` to acknowlege a message and posts `TASK_GENERATED` number
of messages to `PUBLISHER_QUEUE_NAME`
- `job-phase-2` - consumes messages from `CONSUMER_QUEUE_NAME`, it takes
`TASK_DIFFICULTY` to acknowlege a message

## Play with scale
To have more fun with RabbitMQ you can tune environment variables in
`docker-compose.yml` and/or open another shell in this repo and scale each
service to give it a hard time.
```bash
docker-compose scale publisher=3
docker-compose scale job-phase-1=10
docker-compose scale job-phase-2=30
```
Sit back and enjoy logs from your first terminal and RabbitMQ Management Site.
There is a high probability that your queues will grow or you waste compute
resources so you can play scaling game as long as your have computer can handle
it.