Comments (4)
Hi! I opened a pull request...
from aiomqtt.
Hi xydan83. Thanks for opening this issue. Let me have a look. :)
Indeed, asyncio-mqtt doesn't expose the message_retry
parameter yet. I think it's a good idea to add it. π Maybe as a keyword argument to Client.__init__
. Should only be a couple of lines of code.
Do you want to submit a pull request with this change?
from aiomqtt.
Sorry for the late reply. Yes, I can make a pull request.
At the moment I got around this by inheritance, but it doesn't look very good.
from asyncio_mqtt import Client as MQTT_Client
class WrapMQTTClient(MQTT_Client):
"""
A wrapper class for the MQTT_Client class to implement the missing features
"""
def __init__(self, hostname: str,
port: int = 1883,
username: Optional[str] = None,
password: Optional[str] = None,
logger: Optional[logging.Logger] = None,
client_id: Optional[str] = None,
tls_context: Optional[ssl.SSLContext] = None,
protocol: Optional[ProtocolVersion] = None,
will: Optional[Will] = None,
clean_session: Optional[bool] = None,
transport: str = "tcp",
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
clean_start: bool = mqtt.MQTT_CLEAN_START_FIRST_ONLY,
properties: Optional[Properties] = None,
message_retry_set: int = 20): # <--- This is a new param
super().__init__(hostname=hostname,
port=port,
username=username,
password=password,
logger=logger,
client_id=client_id,
tls_context=tls_context,
protocol=protocol,
will=will,
clean_session=clean_session,
transport=transport,
keepalive=keepalive,
bind_address=bind_address,
bind_port=bind_port,
clean_start=clean_start,
properties=properties)
# The parameter was not passed in async_mqtt,
# which sets the time after which Paho will resend the message if QoS> 0.
self._client.message_retry_set(message_retry_set)
from aiomqtt.
Thanks for the PR. π I merged into master. :)
from aiomqtt.
Related Issues (20)
- MQTT broker reports a disconnection/reconnection... but no aiomqtt.MqttError is raised HOT 4
- Exceptions on __aenter__ not handled. HOT 2
- Reconnect Bug HOT 1
- Cannot instantiate a client due to internal mqtt problem HOT 2
- Issues with uvicorn on Windows 10 HOT 5
- [BUG] Cannot install version 2.0.0 with paho-mqtt 2.0.0 HOT 2
- [BUG] 127.0.0.1/localhost Work Incorrectly HOT 3
- Do not send messages for a long time mqtt automatically disconnects HOT 2
- Can't read incoming messages in pytests HOT 8
- No convenient way to get message without getting locked into a for loop HOT 2
- Can aiomqtt queue has a ring buffer optionοΌ for high frequense in-comming messages? HOT 1
- Is it necessary to support mqtt connection pool? HOT 1
- Operation timed out HOT 2
- DeprecationWarning: HOT 1
- Add optional dependency for PySocks to support proxy
- aiomqtt client_id HOT 2
- [Request] AnyIO compatibility HOT 1
- FastAPI Shared Client Connection HOT 1
- Iteration method stuck in a loop when parent process dies HOT 1
- Client misses disconnection event HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiomqtt.