Quarkus - Hivemq Client
This extension allows usage of the HiveMQ MQTT Client inside a Quarkus App, in JVM and Native mode.
Together with the "SmallRye Reactive Messaging MQTT" extension allows usage of a new connector type smallrye-mqtt-hivemq that will use HiveMQ MQTT Client instead of Vertx MQTT client.
This adds some benefits to the original SmallRye MQTT:
-
Battle tested MQTT Client outside of Vertx landscape
-
Management of external CA file for secure connections with self-signed certificates
-
Backpressure support integrated with MQTT QOS
-
Automatic and configurable reconnection handling and message redelivery
-
Real Health Check againsts a configurable topic (defaults to the standard MQTT $SYS/broker/uptime) integrated in Quarkus HealthReport
-
Many others you can read in official documentation here.
Installation
If you want to use this extension, you need to add the io.quarkiverse.hivemqclient:quarkus-hivemq-client
extension first.
In your pom.xml
file, add:
<dependency>
<groupId>io.quarkiverse.hivemqclient</groupId>
<artifactId>quarkus-hivemq-client</artifactId>
</dependency>
If you also want to use SmallRye Reactive Messaging integration in your pom.xml
file, add:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-mqtt</artifactId>
</dependency>
Extension Configuration Reference
These are the configurations added to the original SmallRye’s MQTT Connector once this is specified in application.properties
:
<dependency>
<groupId>io.quarkiverse.hivemqclient</groupId>
<artifactId>quarkus-hivemq-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-mqtt</artifactId>
</dependency>
Configuration property |
Type |
Default |
Direction |
---|---|---|---|
Set the max reconnect attempts. |
int |
|
INCOMING_AND_OUTGOING |
Set the reconnect interval in seconds. |
int |
|
INCOMING_AND_OUTGOING |
File containing the self-signed CA for SSL connection. |
string |
INCOMING_AND_OUTGOING |
|
Enable check for liveness/readiness. |
boolean |
|
INCOMING_AND_OUTGOING |
Topic Used to check liveness/readiness. |
string |
|
INCOMING_AND_OUTGOING |
Timeout to declare the MQTT Client not ready (in ms). |
int |
|
INCOMING_AND_OUTGOING |
Timeout to declare the MQTT Client not alive. |
int |
|
INCOMING_AND_OUTGOING :leveloffset!: |