I'm using Python with the paho-mqtt library for an application where I'll have multiple devices connecting to a broker over 3G constantly sending data that will be stored in a database. For this data is quite important, I needed some kind of confirmation that the MQTT messages from the devices have been successfully delivered to the broker. Is there a way of doing that?
On the publish method you can set the QoS 1 or 2. QoS level 1 guarantees that a message is delivered at least one time to the receiver. The sender stores the message until it gets a  PUBACK packet from the receiver that acknowledges receipt of the message. It is possible for a message to be sent or delivered multiple times. QoS 2 is the highest level of service in MQTT. This level guarantees that each message is received only once by the intended recipients. QoS 2 is the safest and slowest quality of service level. The guarantee is provided by at least two request/response flows (a four-part handshake) between the sender and the receiver. The sender and receiver use the packet identifier of the original PUBLISH message to coordinate delivery of the message.
Is there a way to assure a message's been delivered to the broker in MQTT with Paho MQTT for Python?