tinybroker is a single-node, in-memory message broker over gRPC. No clustering, no persistence, no operational complexity.
When to reach for it: you have a small fleet of replicated services that need pub/sub fan-out, lightweight coordination, or task broadcasting — but standing up Kafka, Pulsar, NATS JetStream, or RabbitMQ is disproportionate. tinybroker starts in milliseconds, uses negligible memory at rest, and disappears cleanly when your service does.
Quick start
docker run -p 50051:50051 -p 8080:8080 -p 9090:9090 phughk/tinybroker:latest
Or download the compose file and run docker compose up.
| Port | Purpose |
|---|---|
50051 | gRPC API |
8080 | Health — GET /health, GET /ready |
9090 | Prometheus metrics — GET /metrics |
Features
- Fan-out pub/sub. Publish to a topic; every matching subscriber receives a copy.
- Wildcard patterns. Subscribe to
orders.*,user.eu.*.login, or any glob-style pattern. - Dynamic pattern management. Add or remove patterns on a live subscription stream without reconnecting.
- In-memory only. A restart clears all state. Pair with a database outbox when durability matters.
- Single static binary. Container image under 10 MB. One gRPC interface, client libraries in any language.
gRPC API
| RPC | Type | Description |
|---|---|---|
Publish | Unary | Publish a message to a named topic |
Subscribe | Bidirectional stream | Send pattern commands, receive message events |
GetTopics | Unary | List known topics with an optional glob filter |
RemoveSubscription | Unary | Close a subscription by ID |
Ack | Unary | Acknowledge a message (no-op in fan-out mode) |
Full proto definitions: proto/tinybroker/v1/
Configuration
{
bind: {
grpc: "[::]:50051",
health: "[::]:8080",
metrics: "[::]:9090",
},
channel: {
command_capacity: 100, // all broker commands + publishes
consumer_capacity: 100, // per-subscriber delivery buffer
event_capacity: 64, // per-subscriber gRPC response buffer
},
log: { format: "text" }, // "text" or "json"
}
CLI flags take precedence: --grpc-bind, --health-bind, --metrics-bind, --config