I am confused by the programming model of mqtt. My goal is to deploy a client that periodically retrieves sensor data and publish them on a topic via mqtt paho client.
In the code-examples from paho after every publication they disconnects, but i have also see examples where the client published data without a disconnect message sending after each sensor data publication. What is the best approach ?