The HiveMQ MQTT Client 1.2.0 is released
The HiveMQ team is pleased to announce the availability of HiveMQ MQTT Client 1.2.0.
This feature release provides plenty of great new features and improvements:
🌟 Features
Manual message acknowledgment Use case: Ensure at least once delivery from the broker even if client applications crash
- Selectively enable manual acknowledgment for specific streams
- Acknowledge messages that are emitted to multiple streams independently per stream (the client aggregates the acknowledgments before sending MQTT acknowledgments)
- Order of manual acknowledgment does not matter (the client automatically ensures the order of MQTT acknowledgments for 100% compatibility with the MQTT specification)
New Reactor API Use case: Easier integration into reactor applications
Decoupled subscription/publishing lifecycles from connection/session lifecycles
Subscribe and unsubscribe operations can now be called irrespective of the current connection status (similar to the publishes operation) Use case: Set up subscriptions before connecting the client
Restore subscriptions automatically if the session expires and the client reconnects (enabled by default, configurable) Use case: Easier to build continuously-connected applications that need to maintain their subscriptions as long as the application is running (even in the edge case that the session expires)
Republish pending and queued messages even if the session expires and the client reconnects (disabled by default, configurable) Use case: Easier to build continuously-connected applications that want to ensure at-least-once delivery to the broker (even in the edge case that the session expires)
New transport features:
Proxy support: SOCKS4, SOCKS5, HTTP CONNECT Use case: Tunnel the MQTT connection through a proxy
Improved TLS support:
- TLS Session Resumption Use case: Consume less bandwidth and computing resources when reconnecting and resuming a TLS session
- Hostname verification: Default is the same as HTTPS hostname verification, but can be customized Usecase: Verify that you are communicating with the right broker
Specify a WebSocket query string Usecase: Communicate with WebSocket endpoints that require a query string
Specify the local bind address and/or port Use case: Support multiple network interfaces
Configurable timeouts:
- Socket connect timeout
- MQTT connect timeout
- WebSocket handshake timeout
- Proxy handshake timeout
New bulk builder methods for consuming arrays, collections, or streams:
- User properties builder
addAll
- Subscribe builder
addSubscriptions
- Unsubscribe builder
addTopicFilters
- User properties builder
✨ Improvements
- Added
CheckReturnValue
annotation that enables IDE assistance to flag unused return values - Javadoc and code style improvements
🗒️ Miscellaneous
- Modularization of artifacts
Reasoning: Keep required dependencies to a minimum, future releases might add more modules for diverse integrations
hivemq-mqtt-client
: Base dependencyhivemq-mqtt-client-websocket
: Adds dependencies for the WebSocket transporthivemq-mqtt-client-proxy
: Adds dependencies for the proxy transporthivemq-mqtt-client-epoll
: Adds dependencies for the native epoll socket implementationhivemq-mqtt-client-reactor
: Reactor API for the HiveMQ MQTT Client
⚠️ Behavioral changes
By default, subscriptions are now automatically restored when the session expires and the client reconnects. If desired, the default behavior can be disabled with
MqttClientReconnector.resubscribeIfSessionExpired(false)
When TLS is used, HTTPS hostname verification is now performed by default, but can be customized with
MqttClientSslConfigBuilder.hostnameVerifier
The
hivemq-mqtt-client
artifact in version 1.1.4 and below is now modularized into the artifactshivemq-mqtt-client
,hivemq-mqtt-client-websocket
, andhivemq-mqtt-client-epoll
If you use the WebSocket transport or the native epoll socket implementation, please specify the additional dependencies
You can get the new version as a Maven artifact from Maven Central, JCenter, or JitPack.
Be sure to check out the project on GitHub.
We recommend to upgrade if you are an HiveMQ MQTT Client library user.
Have a great day,
Silvio from the HiveMQ Team
HiveMQ Team
The HiveMQ team loves writing about MQTT, Sparkplug, Industrial IoT, protocols, how to deploy our platform, and more. We focus on industries ranging from energy, to transportation and logistics, to automotive manufacturing. Our experts are here to help, contact us with any questions.