HiveMQ 4 Notes
2 min readApr 2, 2019
What’s new:
- Supports MQTT 5
- Shared Subscriptions
- Requires JDK11
Differences between MQTT 3 and 5
- Supports JWT (via the AUTH packet)
- Supports disconnect reason
> DISCONNECT packets can carry Reason Codes, so it’s easy to indicate what was the reason for the disconnection (e.g. in case of invalid permissions) - New Data Type: UTF-8 String pairs
P̶l̶u̶g̶i̶n̶ Extension
Replaced hivemq-spi
with hivemq-extension-sdk
I found hivemq-extension-sdk
requires JDK9, it doesn’t make sense, because it doesn’t use anything JDK9 specific, so I recompiled it for JDK8:
dependencies {
implementation 'com.github.yongjhih:hivemq-extension-sdk:65af6066b1'
}
And then I made a hivemq-hello-work-extension project which supports gradle build:
Misc
- Released hivemq-mqtt-client for java which supports RxJava (No Android Optimization yet)
- Official docker images on docker hub: https://hub.docker.com/r/hivemq/hivemq4
- I found they implemented with Null-safety and misc annotations
HiveMQ MQTT Client
Usage:
It doesn’t support auto-reconnect yet (it will soon), we can do a simple backoff: