Paho MQTT Python - Clear topic queue if new message published
No, this is not possible.
The only thing that would cause messages to back up on the client is if you are publishing them quicker than the client can send them to the broker, which under normal circumstances will be a product of the network speed between the client and the broker.
The only other thing that might have an impact would be if you are manually running the network loop and you are not calling it often enough.
I am developing a robotics project which sends a livestream of images. The images are all published to the same topic. What I am finding is that a backlog is created and a delay starts to form between images being sent for publish and them actually being published.
I am assuming there is some form of internal buffer / queueing system in PAHO MQTT which is causing this.
Given the nature of the project I am not precious about each image being published, ideally I'd be able to drop any messages that are waiting to be published to a certain topic and re-publish new content. Does anyone know if this is possible, and if so how?
Thank you