Mqtt Class

  • java.lang.Object
    • MqttCallback
      • com.microsoft.azure.sdk.iot.device.transport.mqtt.Mqtt

public class Mqtt

Method Summary

Modifier and Type Method and Description
void connectionLost(Throwable throwable)

Event fired when the connection with the MQTT broker is lost.

void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken)

Event fired when the message arrived on the MQTT broker.

void messageArrived(String topic, MqttMessage mqttMessage)

Event fired when the message arrived on the MQTT broker.

IotHubTransportMessage receive()

Method to receive messages on mqtt broker connection.

Method Details

connectionLost

public void connectionLost(Throwable throwable)

Event fired when the connection with the MQTT broker is lost.

Parameters:

throwable - Reason for losing the connection.

deliveryComplete

public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken)

Event fired when the message arrived on the MQTT broker.

Parameters:

iMqttDeliveryToken - the MqttDeliveryToken for which the message was successfully sent.

messageArrived

public void messageArrived(String topic, MqttMessage mqttMessage)

Event fired when the message arrived on the MQTT broker.

Parameters:

topic - the topic on which message arrived.
mqttMessage - the message arrived on the Mqtt broker.

receive

public IotHubTransportMessage receive()

Method to receive messages on mqtt broker connection.

Returns:

a received message. It can benull 

</code></p>

Applies to