mqtt-broker
A production-grade MQTT 3.1.1 broker implementation in Rust.
Features
- π High Performance β Async I/O with Tokio, handles 10,000+ concurrent connections
- π‘ Full MQTT 3.1.1 β All 14 packet types with complete protocol compliance
- π― QoS 0/1/2 β Complete delivery guarantees with proper state machines
- π³ Topic Wildcards β O(k) trie-based matching for
+and#wildcards - πΎ Retained Messages β Automatic delivery to new subscribers
- π Session Persistence β Clean and persistent session support
- β±οΈ Keep-Alive β Automatic connection timeout detection
- π‘οΈ Production Ready β Comprehensive test suite with 176+ tests
What is MQTT?
MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol designed for constrained devices and low-bandwidth, high-latency networks. Itβs widely used in:
- IoT (Internet of Things) β Sensor data collection, device control
- Home Automation β Smart home devices, lighting, thermostats
- Mobile Applications β Push notifications, real-time messaging
- Industrial Systems β SCADA, telemetry, monitoring
Quick Example
# Terminal 1: Start the broker
mqtt-broker
# Terminal 2: Subscribe to temperature readings
mqtt-consumer "sensors/+/temperature"
# Terminal 3: Publish a temperature reading
mqtt-producer "sensors/living-room/temperature" "23.5Β°C"
Next Steps
- Installation β Get mqtt-broker running
- Quick Start β Your first pub/sub in 5 minutes
- MQTT Concepts β Learn the protocol basics