-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Distributed message pub/sub service built on socket.io and Node.js.
tyo-mq is a lightweight message broker: producers publish events, consumers subscribe to them, and the server routes messages between them over WebSockets — with optional authentication, multi-tenant realm isolation, durable queues, delivery guarantees, MQTT-style topic routing, and multi-node clustering. The browser is a first-class client.
npm install tyo-mqconst { Server, Factory } = require('tyo-mq');
new Server().start(); // broker on port 17352
const mq = new Factory({ host: 'localhost', port: 17352, protocol: 'http' });
const producer = await mq.createProducer('weather-station');
const consumer = await mq.createConsumer('dashboard');
consumer.subscribe(producer.name, 'temperature', (data) => console.log(data));
producer.produce('temperature', { celsius: 21.5 });| Area | What you get |
|---|---|
| Pub/sub | Named producers and consumers, per-event subscriptions, large-message chunking (256 KB frames), reconnect awareness |
| Auth & realms | Opaque tokens, HS256 JWTs, external validators (scopable per realm/prefix); full multi-tenant isolation per realm; permanent or [[Ephemeral Realms |
| Connection authorization | Per-realm pre-shared keys for consumers, acceptance flow for producers, manual approval for managers |
| Durability | Pluggable storage (memory / SQLite / Redis / custom), offline delivery, per-message TTL |
| Reliability | Per-subscription ACK, retry with backoff, dead-letter queue with replay |
| Routing | MQTT-style topic wildcards (+, #), consumer groups (round-robin), realm and group broadcast |
| Observability | Opt-in HTTP API: health, Prometheus metrics, live stats, DLQ inspection |
| Management | Signed socket commands (admin token never crosses the wire), interactive CLI, web manager UI |
| Abuse protection | Opt-in [[Rate Limits and Quotas |
| Clustering | Multi-node deployment over one shared Redis: settings sync, cross-node routing, shared authorization requests |
| Remote streaming |
/remote namespace for one-time-ticket binary streaming sessions (screen frames, input relay) |
- New to tyo-mq? → Getting Started
- Configuring a server? → Server Configuration
- Locking it down? → Authentication and Realms, Roles and Connection Authorization
- Need delivery guarantees? → Persistence and Durable Delivery, ACK, Retry and the Dead Letter Queue
- Routing patterns? → Topics and Wildcards, Consumer Groups, Broadcast
- Running a fleet? → Clustering, Observability HTTP API
- Wire-level details? → Protocol Reference
All features beyond basic pub/sub are opt-in — a default server behaves like the original simple broker, and every release is backwards compatible with existing clients.
Current version: 0.11.x. All six phases of the improvement plan are implemented; see Versioning and Roadmap. Licensed under Apache-2.0.
tyo-mq · README · Improvement Plan · Clustering Guide · Apache-2.0
Basics
Security
- Authentication and Realms
- Ephemeral Realms
- Roles and Connection Authorization
- Authorization Requests
Delivery
Routing
Operations
Reference