I am using the current version of Paho MQTT android client,( compile org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0
) and I am trying to get the message ID from every message received from the messageArrived()
callback. This is how I am doing it.
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
String plainMessage = new String(message.getPayload());
int messageID= new Integer(message.getId());
System.out.println(messageID);
}
Update
With a QoS
of 2
The message ID returns Zero anytime the message arrives or the method messageArrived is called.
Please does anybody has any ideas as to how to resolve this?