Oversimplified MQTT broker written from scratch, which mimick mosquitto features. Implemented for learning how the protocol works, for now it supports almost all MQTT v3.1.1 commands on linux platform; it relies on EPOLL interface for multiplexing I/O. Development process is documented in this series of posts.
$ cmake .
$ make
The broker can be tested using mosquitto_sub
and mosquitto_pub
or with
paho-mqtt
python driver.
To run the broker with DEBUG loggin on:
$ ./sol -v
A simple configuration can be passed in with -c
flag:
$ ./sol -c path/to/sol.conf
It's still a work in progress but it already handle the most of the basic features expected from a MQTT broker.
- Unix/TCP sockets
- All main commands are handled correctly
- QoS 0, 1, 2 are handled
- Trie as underlying structure to handle topic hierarchies
- Periodic tasks like stats publishing
- Wildcards on subscriptions (though simple to implement, will be added soon)
- QoS 1 and 2 tracking of pending clients and re-send
- Session present check and handling
- Authentication
- SSL/TLS connections
- Last will & Testament
- Check on max memory used
It apparently not leak memory as of now, there's probably some corner cases, not deeply investigated yet.
Pull requests are welcome, just create an issue and fork it.