A Redis pub/sub demo in Go: one service publishes, another subscribes, and Redis sits between them.
Written to see the mechanics end to end rather than to be depended on.
| Path | What it is |
|---|---|
publisher/ |
publishes messages to a Redis channel |
subscriber/ |
subscribes to that channel and prints what arrives |
redis/conf/ |
the Redis config the compose file mounts |
The two services are separate Go modules with a Dockerfile each, so they build and run independently.
docker compose upThat starts Redis, the publisher and the subscriber together. To run a side
outside Docker, go run main.go from publisher/ or subscriber/ with Redis
reachable on its usual port.