A Python async MQTT client with full MQTT v5.0 protocol support and automatic reconnection.
gmqtt is a Python asynchronous MQTT client library that implements the MQTT v5.0 protocol. It enables developers to build efficient, non-blocking IoT and messaging applications by providing a robust interface for connecting to MQTT brokers, publishing messages, and handling subscriptions with full protocol support.
Python developers building IoT systems, real-time messaging applications, or any project requiring asynchronous MQTT communication with support for modern protocol features.
Developers choose gmqtt for its native asyncio integration, comprehensive MQTT v5.0 support, and automatic reconnection capabilities, making it a reliable and performant choice for scalable messaging solutions.
Python MQTT v5.0 async client
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the entire MQTT 5.0 protocol with automatic downgrade to 3.1, as mentioned in the README, ensuring compatibility with modern brokers and legacy systems.
Built on asyncio for non-blocking operations and compatible with uvloop for enhanced event loop performance, making it ideal for high-concurrency applications as highlighted in the examples.
Configurable reconnect logic with unlimited retries by default, providing robust handling of network interruptions, detailed in the Reconnects section of the README.
Supports both synchronous and asynchronous on_message callbacks with PUBACK code returns, allowing custom message processing logic, as shown in the callback examples.
The automatic downgrade to MQTT 3.1 relies on broker responses; if a broker fails to parse 5.0 packets correctly, connectivity issues may arise, as cautioned in the README.
Primarily designed for asyncio, making it less suitable for synchronous Python projects without additional setup or refactoring, which can increase complexity.
Setting up MQTT 5.0 properties like session expiry or user properties involves verbose code, as seen in the examples, potentially overcomplicating simple use cases.