Nano MQTT Broker A light-weight and Blazing-fast MQTT Broker for IoT Edge platform.
- Cost-effective on embedded platform.
- Fully base on native POSIX. High Compatibility.
- Pure C/C++ implementation. High portability.
- Fully asynchronous I/O and multi-threading.
- Good support for SMP.
- Low latency & High handling capacity.
- Compile & Install
NanoMQ is base on NNG's asynchronous I/O threading model. With rewriting the TCP/SP part with self-added protocol: nano_tcp.
To build this whole project, you will need a C99 compatible & C++11 compiler and CMake version 3.13 or newer.
Basically you just need to simply compile and install nanomq by:
or you can limit threads by
cmake -DNOLOG=0
Please be aware that nanomq depends on nanolib & nng (MQTT ver)
both dependencies can be complied independently
compile nanolib independently:
Currently, NanoMQ only supports basic MQTT 3.1.1 Pub/Sub with Qos 0. In short future, We will release a roadmap, and next version of NanoMQ with full MQTT 5.0 support. Also, in order to let NanoMQ be compatible with NNG library and SP, implementing a subsystem to let nanomq support MQTT without damaging NNG's SP support. Rewriting CMake and MakeFile so that users can easily choose which ver of nng to base on.
===============================================
- Usage:
#ongoing MQTT Broker sudo ./nanomq broker start 'tcp://localhost:1883' &
#test POSIX message Queue sudo ./nanomq broker mq start/stop
===============================================
- Debug:
For Support & Debug, NanoMQ has a Debugging system which logs all information from all threads. It is enabled by default. And you can disable/enable it by:
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DNOLOG=1 ..
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DNOLOG=0 ..
- Mqueue support:
For macos, mqueue is not support, you can set -DMQ=0 to disable it. It is enabled by default.
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DMQ=1 ..
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DMQ=0 ..
- More parameter support: For macos, mqueue is not support, you can set -DMQ=0 to disable it. It is enabled by default.
set max emq packet size, default is 512
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DEMQ_PACKET_SIZE=set ..
set max emq header size, default is 5
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DEMQ_HEADER_SIZE=set ..
set emq property size, default is 32
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DEMQ_PROPERTY_SIZE=set ..
set nano qos length, default is 64
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DNANO_QOS_LEN=set ..
set nano msq length, default is 64
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DNANO_MSQ_LEN=set ..
set nano qos timer, default is 30
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DDNANO_QOS_TIMER=set ..
set nano publish client, default is 256
$PROJECT_PATH/nanomq/build$ cmake -G Ninja -DNANO_PUB_CLIENT=set ..
You can Join us on Slack channel:
#nanomq: general usage
#nanomq-dev : for MQTT lover & developer
#nanomq-nng : for users & nng project.
More communities on github, slack, reddit, twitter, gitter, discord are coming soon.
The EMQ X team.