public interface MqttCallback
|Modifier and Type||Method and Description|
This method is called when the connection to the server is lost.
This method is called when a message arrives from the server.
void connectionLost(Throwable cause)
cause- the reason behind the loss of connection.
void messageArrived(String topic, MqttMessage message) throws Exception
This method is invoked synchronously by the MQTT client.
If an implementation of this method throws an
Exception, then the client will be shut down.
Any additional messages which arrive while an implementation of this method is running will back up on the network.
topic- name of the topic on the message was published to.
message- the actual message.
Exception- if a terminal error has occurred, and the client should be shut down.