简体   繁体   中英

Ruby: Does paho-mqtt with QOS=1 automatically resend (re-publish) unacknowledged messages for me?

I am using the paho-mqtt gem in ruby.
I was wondering if the gem automatically resends (re-publish) the message to the MQTT broker in case PUBACK is not received on client side for some reason, or do I have to do it manually? QOS=1

ex (this is me publishing with QOS=1, and not doing anything else):

client = PahoMqtt::Client.new

client.on_puback do
  puts "PUBACK received"
end

client.connect(@mqtt_server_ip, @mqtt_server_port)
client.publish(topic, message_payload, false, 1)

I ended up doing it manually using the on_puback callback. The answer is it has to be done manually :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM