-
Notifications
You must be signed in to change notification settings - Fork 21
Develop MQTT Hive
Frieder edited this page Feb 6, 2024
·
2 revisions
CorreoMQTT is using the hivemq-mqtt-client library: https://hivemq.github.io/hivemq-mqtt-client/
The CorreoMQTT core is using a small wrapper around this library.
Each connection in CorreoMQTT has an internal id. This id is basically related to tab you are in. So usually the code that calls your task will provide you that id and there is already an existing client for it.
To get the client for a specific connection, just call: connectionHolder.getClient(connectionId)
. ConnectionHolder
must be injected using DependencyInjection.
This will give you a CorreoMqttClient
, where you can call your mqtt functionality.
void connect() throws InterruptedException, ExecutionException, TimeoutException, SSLException;
void disconnect(boolean graceful);
void publish(MessageDTO messageDTO) throws InterruptedException, ExecutionException, TimeoutException;
void subscribe(SubscriptionDTO subscriptionDTO, Consumer<MessageDTO> incomingCallback) throws InterruptedException, ExecutionException, TimeoutException;
void unsubscribe(SubscriptionDTO subscriptionDTO);
Set<SubscriptionDTO> getSubscriptions();
QUICK NAV
For users
For developers