wialon / gmqtt

Python MQTT v5.0 async client
MIT License
400 stars 52 forks source link

Possibility of not acknowledging a published message #115

Open canique opened 4 years ago

canique commented 4 years ago

Based on https://github.com/wialon/gmqtt/issues/113 I suggest to have the ability to not acknowledge a message at all. So it should be possible to "return None" in the on_message callback (without raising an exception).

Why? If I want to process a message, but some backend system that I need for processing is unavailable right now, I'd either have to store the message locally somewhere (and process it later) or let the broker know that I have not processed it at all.

Another partial solution would be to disconnect from the broker as long as the backend is unavailable, but still there is a time window where some messages might slip through.

Mixser commented 4 years ago

Hi, @canique

Good point, we will implement this.