Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] how to use the new mqttPresistence, Qos and the acknowledge from the MQTT broker

hi my name is peiyuan, currenly i am able to write a simple publisher and subscriber using java code and eclipse paho client thank to James.  Now i would like to go into QoS service and new MqttPresistence . So is there any tutorial or sample i can learn from it. 

At the same time i had problem in my current mqttpublisher how to return the connack from the broker server that i had connect to it? Because i want to know let say i forget to turn on my mosquitto server and hence i am not able to connect but currently even if i did not turn on my server, my client is still not a null and it till show is connected after i went through the debug mode 

my current code 

Mqttclient client = new Mqttclient (TCPaddress, ClientID, new Memorypresistence)

if (client != null)
{
    client .connect;

    if (!client.isconnected)
    {
        client.publish("topic", new MqttMessage("Message".getbytes));
}

thank you 
peiyuan 

Back to the top