Backend Development 12 min read

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.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
Unlock Low‑Latency IoT Messaging with mica‑mqtt: A Java AIO MQTT Solution

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-plugin

and

mica-mqtt-server-solon-plugin

(thanks @peigenlpy).

Renamed JFinal plugins to

mica-mqtt-client-jfinal-plugin

and

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>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-client-spring-boot-starter&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-client-spring-boot-starter documentation.

Server dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-server-spring-boot-starter&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-server-spring-boot-starter documentation.

6.2 Solon

Client dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-client-solon-plugin&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-client-solon-plugin documentation.

Server dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-server-solon-plugin&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-server-solon-plugin documentation.

6.3 JFinal

Client dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-client-jfinal-plugin&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-client-jfinal-plugin documentation.

Server dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-server-jfinal-plugin&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-server-jfinal-plugin documentation.

6.4 Other Java Projects

Client dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-client&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</code>

See the mica-mqtt-client documentation.

Server dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;net.dreamlu&lt;/groupId&gt;
  &lt;artifactId&gt;mica-mqtt-server&lt;/artifactId&gt;
  &lt;version&gt;${mica-mqtt.version}&lt;/version&gt;
&lt;/dependency&gt;</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

JavaBackend Developmentopen-sourceIoTMQTT
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.