public interface IMqttDeliveryToken extends IMqttToken
A subclass of IMqttToken that allows the delivery of a message to be tracked. Unlike instances of IMqttToken delivery tokens can be used across connection and client restarts. This enables the delivery of a messages to be tracked after failures. There are two approaches
IMqttAsyncClient.getPendingDeliveryTokens()
. The waitForCompletion
method can then be used to block until the delivery is complete.
MqttCallback
can be set on the client. Once a message has been
delivered the MqttCallback.deliveryComplete(IMqttDeliveryToken)
method will
be called withe delivery token being passed as a parameter.
An action is in progress until either:
Modifier and Type | Method and Description |
---|---|
MqttMessage |
getMessage()
Returns the message associated with this token.
|
getActionCallback, getClient, getException, getGrantedQos, getMessageId, getResponse, getSessionPresent, getTopics, getUserContext, isComplete, setActionCallback, setUserContext, waitForCompletion, waitForCompletion
MqttMessage getMessage() throws MqttException
Until the message has been delivered, the message being delivered will
be returned. Once the message has been delivered null
will be
returned.
MqttException
- if there was a problem completing retrieving the message