mqtt-kat is an attempt at an MQTT broker based on the concepts of http-kit. As http-kit this means low level java code to do the handling of the NIO and decoding and encoding of the MQTT packets. MQTT packets are en/decoded to Clojure maps and handled by Clojure code to do all the clever stuff a broker needs to do.
The idea is to see if a MQTT Broker could be as scalable as http-kit and handle as many concurrent connection as http-kit does.
Well... with the latest push it can actually forward a PUBLISH
ed message to multiple clients that have SUBSCRIBE
d to a particular topic. I have tested this with three subscribers concurrently.
Yes!
Loads. Too many to mention actually. But here are a few I know of:
- Disconnecting clients in error cases is not fully implemented.
- At the moment the message flows for good path QOS 0, 1 and 2 is in place. But there is no error recovery if one of the packets gets lost. So no resending of packets.
- Also latency is rather high, to be investigated.
I first thought of calling it mqtt-kit... but then decide that mqtt-kat made more sense. Somehow.
Probably not.
Probably not.
https://gist.github.com/Botffy/3860641
http://tutorials.jenkov.com/java-nio/non-blocking-server.html
http://docs.oasis-open.org/mqtt/mqtt/v5.0/csprd01/mqtt-v5.0-csprd01.html
https://github.com/http-kit/http-kit
https://github.com/eclipse/paho.mqtt.java
https://lispcast.com/3-things-java-can-steal-from-clojure/
https://gist.github.com/yukaizhao/155d931326e298d6404f
http://rox-xmlrpc.sourceforge.net/niotut/
I call (start)
function in the repl and then use an MQTT client to send packets to it and wait for it to crash.
First of all an extra big thank you to Feng Shen for making http-kit. I have borrowed heavily from his code. And also a big thank you to the Eclipse Paho Project. I have used their code as inspiration as well and yes I have copied the MQTT packet length code from them.
And also a big thank you for the people from ClojureWerkz for their triennium library. It just works.
Copyright © 2018 Thomas van der Veen
Distributed under the Apache License Version 2.0.