44
55# HiveMQ MQTT Client
66
7- [](https://travis-ci.org/hivemq/hivemq-mqtt-client)
87[](https://maven-badges.herokuapp.com/maven-central/com.hivemq/hivemq-mqtt-client)
98[](https://jitpack.io/#hivemq/hivemq-mqtt-client)
9+ [](https://travis-ci.com/hivemq/hivemq-mqtt-client)
10+ [](https://lgtm.com/projects/g/hivemq/hivemq-mqtt-client/context:java)
11+ [](https://lgtm.com/projects/g/hivemq/hivemq-mqtt-client/alerts/)
1012
1113MQTT 5.0 and 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and
1214backpressure support.
@@ -22,23 +24,44 @@ backpressure support.
2224
2325## Features
2426
25- - All MQTT 3.1.1 and MQTT 5.0 features
27+ - **All [MQTT 3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html) and
28+ [MQTT 5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html) features**
2629- API flavors:
27- - Reactive, Async and Blocking
28- - Flexible switching
29- - Consistent and clearly separated
30- - Backpressure support:
30+ - **Reactive**: [Reactive Streams](https://www.reactive-streams.org/) compatible,
31+ [RxJava](https://github.com/ReactiveX/RxJava) and [Reactor](https://github.com/reactor/reactor-core) APIs available
32+ - **Asynchronous API**: futures and callbacks
33+ - **Blocking API**: for quick start and testing
34+ - Switch flexibly between flavours and use them concurrently
35+ - Flavours are clearly separated but have a consistent API style
36+ - **Backpressure support**:
3137 - QoS 1 and 2
3238 - QoS 0 (dropping incoming messages, if necessary)
39+ - Bringing MQTT flow control and reactive pull backpressure together
3340- Transports:
3441 - TCP
35- - SSL/TLS
36- - WebSocket, Secure WebSocket
37- - Automatic and configurable thread management
38- - Automatic and configurable reconnect handling and message redelivery
39- - Lifecycle listeners (connected, disconnected)
42+ - **SSL/TLS**
43+ - All TLS versions up to TLS 1.3 are supported
44+ - TLS mutual authentication
45+ - TLS Server Name Indication (SNI)
46+ - TLS Session Resumption
47+ - Default and customizable hostname verification
48+ - **WebSocket**, Secure WebSocket
49+ - **Proxy**: SOCKS4, SOCKS5, HTTP CONNECT
50+ - All possible combinations
51+ - Automatic and configurable **thread management**
52+ - Automatic and configurable **reconnect handling and message redelivery**
53+ - Automatic and configurable **resubscribe if the session expired**
54+ - **Manual message acknowledgment**
55+ - Selectively enable manual acknowledgement only for specific streams
56+ - Acknowledge messages emitted to multiple streams independently per stream,
57+ the client aggregates the acknowledgements before sending MQTT acknowledgements
58+ - Order of manual acknowledgment does not matter,
59+ the client automatically ensures the order of MQTT acknowledgments for 100% compatibility with the MQTT specification
60+ - Lifecycle listeners
61+ - When connected
62+ - When disconnected or connection failed
4063- MQTT 5 specific:
41- - Pluggable Enhanced Auth support (additional to MQTT specification: server-triggered reauth )
64+ - Pluggable Enhanced Authentication support (additional to MQTT specification: server-triggered re-authentication )
4265 - Automatic Topic Alias mapping
4366 - Interceptors for QoS flows
4467
@@ -68,7 +91,18 @@ If you use Gradle, just include the following inside your `build.gradle` file.
6891
6992```groovy
7093dependencies {
71- compile group: 'com.hivemq', name: 'hivemq-mqtt-client', version: '1.1.4'
94+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client', version: '1.2.0'
95+ }
96+ ```
97+
98+ For optional features you can choose to include additional modules:
99+
100+ ```groovy
101+ dependencies {
102+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-websocket', version: '1.2.0'
103+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-proxy', version: '1.2.0'
104+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-epoll', version: '1.2.0'
105+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-reactor', version: '1.2.0'
72106}
73107```
74108
@@ -90,7 +124,44 @@ NOTE: You have to set the compiler version to `1.8` or higher.
90124 <dependency>
91125 <groupId>com.hivemq</groupId>
92126 <artifactId>hivemq-mqtt-client</artifactId>
93- <version>1.1.4</version>
127+ <version>1.2.0</version>
128+ </dependency>
129+ </dependencies>
130+ ...
131+ </project>
132+ ```
133+
134+ For optional features you can choose to include additional modules:
135+
136+ ```xml
137+ <project>
138+ ...
139+ <dependencies>
140+ <dependency>
141+ <groupId>com.hivemq</groupId>
142+ <artifactId>hivemq-mqtt-client-websocket</artifactId>
143+ <version>1.2.0</version>
144+ </dependency>
145+ </dependencies>
146+ <dependencies>
147+ <dependency>
148+ <groupId>com.hivemq</groupId>
149+ <artifactId>hivemq-mqtt-client-proxy</artifactId>
150+ <version>1.2.0</version>
151+ </dependency>
152+ </dependencies>
153+ <dependencies>
154+ <dependency>
155+ <groupId>com.hivemq</groupId>
156+ <artifactId>hivemq-mqtt-client-epoll</artifactId>
157+ <version>1.2.0</version>
158+ </dependency>
159+ </dependencies>
160+ <dependencies>
161+ <dependency>
162+ <groupId>com.hivemq</groupId>
163+ <artifactId>hivemq-mqtt-client-reactor</artifactId>
164+ <version>1.2.0</version>
94165 </dependency>
95166 </dependencies>
96167 ...
@@ -101,13 +172,14 @@ NOTE: You have to set the compiler version to `1.8` or higher.
101172
102173If you are experiencing problems with transitive dependencies, you can try the shaded version.
103174This version packs the transitive dependencies which are only used internal under a different package name.
175+ The shaded version includes the websocket, proxy and epoll modules.
104176To use the shaded version just append `-shaded` to the artifact name.
105177
106178#### Gradle
107179
108180```groovy
109181dependencies {
110- compile group: 'com.hivemq', name: 'hivemq-mqtt-client-shaded', version: '1.1.4 '
182+ implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-shaded', version: '1.2.0 '
111183}
112184```
113185
@@ -120,7 +192,7 @@ dependencies {
120192 <dependency>
121193 <groupId>com.hivemq</groupId>
122194 <artifactId>hivemq-mqtt-client-shaded</artifactId>
123- <version>1.1.4 </version>
195+ <version>1.2.0 </version>
124196 </dependency>
125197 </dependencies>
126198 ...
@@ -141,6 +213,12 @@ repositories {
141213
142214dependencies {
143215 implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client:develop-SNAPSHOT'
216+
217+ // snapshots for optional modules
218+ implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-websocket:develop-SNAPSHOT'
219+ implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-proxy:develop-SNAPSHOT'
220+ implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-epoll:develop-SNAPSHOT'
221+ implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-reactor:develop-SNAPSHOT'
144222}
145223```
146224
@@ -163,13 +241,44 @@ dependencies {
163241 <version>develop-SNAPSHOT</version>
164242 </dependency>
165243 </dependencies>
244+
245+ <!-- snapshots for optional modules -->
246+ <dependencies>
247+ <dependency>
248+ <groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
249+ <artifactId>hivemq-mqtt-client-websocket</artifactId>
250+ <version>develop-SNAPSHOT</version>
251+ </dependency>
252+ </dependencies>
253+ <dependencies>
254+ <dependency>
255+ <groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
256+ <artifactId>hivemq-mqtt-client-proxy</artifactId>
257+ <version>develop-SNAPSHOT</version>
258+ </dependency>
259+ </dependencies>
260+ <dependencies>
261+ <dependency>
262+ <groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
263+ <artifactId>hivemq-mqtt-client-epoll</artifactId>
264+ <version>develop-SNAPSHOT</version>
265+ </dependency>
266+ </dependencies>
267+ <dependencies>
268+ <dependency>
269+ <groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
270+ <artifactId>hivemq-mqtt-client-reactor</artifactId>
271+ <version>develop-SNAPSHOT</version>
272+ </dependency>
273+ </dependencies>
166274 ...
167275</project>
168276```
169277
170278Change the artifact name to `hivemq-mqtt-client-shaded` to get snapshots of the shaded version.
171279
172- JitPack works for all branches and also specific commits by specifying in the version.
280+ JitPack works for all branches and also specific commits.
281+ Just specify `<branch>-SNAPSHOT` or the first 10 digits of the commit id in the version.
173282
174283## General principles
175284
0 commit comments