Unlock Low‑Latency IoT Messaging with mica‑mqtt: A Java AIO MQTT Solution
The mica‑mqtt component is a simple, low‑latency, high‑performance open‑source MQTT library built on Java AIO that integrates easily into existing services, supports multiple protocols and frameworks, and provides comprehensive documentation, examples, and deployment options for IoT and messaging applications.
1. Introduction
mica-mqtt is a simple, low‑latency, high‑performance MQTT IoT open‑source component built on Java AIO. It is easy to integrate into existing services and reduces the development cost of custom IoT platforms.
2. Features
Supports MQTT v3.1, v3.1.1 and v5.0.
Supports WebSocket MQTT sub‑protocol (compatible with mqtt.js).
Provides HTTP REST API (see documentation).
Provides MQTT client.
Provides MQTT server.
Supports MQTT will messages.
Supports retained messages.
Custom message processing and cluster forwarding.
Alibaba Cloud MQTT connection demo.
GraalVM native compilation.
Spring Boot starter for quick integration.
Prometheus + Grafana metrics support.
Cluster implementation based on Redis Stream (see mica-mqtt-broker module).
3. Use Cases
IoT cloud MQTT broker.
Edge‑side IoT messaging.
Group chat IM.
Message push.
Simple, easy‑to‑use MQTT client.
4. Release Notes
v2.3.4 – 2024‑08‑10
Added
mica-mqtt-client-solon-pluginand
mica-mqtt-server-solon-plugin(thanks @peigenlpy).
Renamed JFinal plugins to
mica-mqtt-client-jfinal-pluginand
mica-mqtt-server-jfinal-plugin.
Fixed group subscription deletion in server (thanks @tangjj).
v2.3.3 – 2024‑07‑22
Server can be stopped; added schedule methods.
Optimized TopicUtil getTopicFilter method.
Improved AckTimerTask and retry logging (thanks @tan90).
Spring Boot starter now allows custom MqttClientTemplate.
Added SSL test code in examples.
Fixed SSL server restart issue (thanks @geekerstar, @hangrj).
v2.3.1 – 2024‑06‑25
Reworked heartbeat; default mode is last data receipt time (thanks @HY, @tan90).
Improved port‑occupancy error messages.
Client now uses mica-net built‑in heartbeat.
Client always sends subscription on reconnect regardless of session existence (thanks @xiaochonzi).
Snapshot version also publishes source JAR.
Added Renovate bot for dependency updates.
Optimized issue.yml and GitHub Actions.
5. Key Points
5.1 Stop Support
Both the client and server can be fully stopped, enabling plugin‑style development.
5.2 Solon Plugins
Integration with the lightweight Solon Java framework provides millisecond startup and low memory usage (≈100 MB for thousands of connections).
6. Usage
6.1 Spring Boot
Client dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-client-spring-boot-starter</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-client-spring-boot-starter documentation.
Server dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-server-spring-boot-starter</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-server-spring-boot-starter documentation.
6.2 Solon
Client dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-client-solon-plugin</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-client-solon-plugin documentation.
Server dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-server-solon-plugin</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-server-solon-plugin documentation.
6.3 JFinal
Client dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-client-jfinal-plugin</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-client-jfinal-plugin documentation.
Server dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-server-jfinal-plugin</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-server-jfinal-plugin documentation.
6.4 Other Java Projects
Client dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-client</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-client documentation.
Server dependency:
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-mqtt-server</artifactId>
<version>${mica-mqtt.version}</version>
</dependency></code>See the mica-mqtt-server documentation.
7. Documentation
MQTT basics, mqttx, mica-mqtt video tutorials.
mica-mqtt examples and quick start.
Frequently asked questions.
Release versions.
8. Best Practice
Demo site: https://iot.javablade.com
References
HTTP API documentation: https://gitee.com/596392912/mica-mqtt/blob/master/docs/http-api.md
mica-mqtt-broker module: https://gitee.com/596392912/mica-mqtt/blob/master/mica-mqtt-broker
mica-mqtt-client-spring-boot-starter docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-client-spring-boot-starter/README.md
mica-mqtt-server-spring-boot-starter docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-server-spring-boot-starter/README.md
mica-mqtt-client-solon-plugin docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-client-solon-plugin/README.md
mica-mqtt-server-solon-plugin docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-server-solon-plugin/README.md
mica-mqtt-client-jfinal-plugin docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-client-jfinal-plugin/README.md
mica-mqtt-server-jfinal-plugin docs: https://gitee.com/596392912/mica-mqtt/blob/master/starter/mica-mqtt-server-jfinal-plugin/README.md
mica-mqtt-client docs: https://gitee.com/596392912/mica-mqtt/blob/master/mica-mqtt-client/README.md
mica-mqtt-server docs: https://gitee.com/596392912/mica-mqtt/blob/master/mica-mqtt-server/README.md
Video tutorial: https://www.bilibili.com/video/BV1wv4y1F7Av/
Examples & quick start: https://gitee.com/596392912/mica-mqtt/blob/master/example/README.md
FAQ: https://gitee.com/596392912/mica-mqtt/issues/I45GO7
Changelog: https://gitee.com/596392912/mica-mqtt/blob/master/CHANGELOG.md
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.