feat(transport): add mqtt
Hello 👋🏻 ,
I have a few questions concerning my PR:
-
Currently mqtt tests are run only on the hivemq broker because it's the broker included in the testcontainers package. I'm wondering if it's useful to run tests on other mqtt brokers like EMQX ?
-
Concerning the
onReconnectmethod I can't have the same behavior as Redis, the mqtt client handle automatic reconnexion
Currently mqtt tests are run only on the hivemq broker because it's the broker included in the testcontainers package. I'm wondering if it's useful to run tests on other mqtt brokers like EMQX ?
I'm really not familiar with MQTT. What are the most commonly used brokers? It would be cool to include test for those
Also, please update the documentation in the README
Hello @Julien-R44, sorry i've not work on this pr since a long time but now i'm back i will update the readme once you will say me that's the code is legit to a merge
The tests seem to pass.
I do have one question, though. RabbitMQ is a broker that supports acknowledgments, right? So, doesn’t the worker need to acknowledge the job before it’s removed from the bus?
I don't know very well RabbitMQ (I have never use it) but yeah it support acknowledgments like mqtt brokers.
Yes good suggestion, I have forgot that but I can add the QoS option to the MqttTransportConfig to support the acknowledgments. So all messages sended by the producer will have the same quality of service.
This bus package is designed as a fire-and-forget broker, so we're intentionally avoiding any acknowledgment logic.
The question is: can we use RabbitMQ without acknowledgments, or will the message remain in the bus until it's acknowledged by a consumer?
Ah ok my bad. Yes it seems to, but my pr is here to support the mqtt protocol as well as mqtt broker but not amqp and broker like RabbitMQ and Kafka. And by default mqtt has no acknowledgments so it fit your requirements
Is this PR ready @MaximeMRF? Looks all good to me 👍
Any additional comments @RomainLanz, or can we merge this?
@Julien-R44 hi before merge i have to provide the docs
All questions are answered on my side!
Do you plan to use it in your project @MaximeMRF?
Hi @RomainLanz,
Not atm but it can be a interesting alternative to Redis depending of the project.
For example, I have a IOT project and I use a mqtt broker to transport datas from my sensors to a backend and if in the future, I want to use the bus package I can simply dedicate some topics of my broker for that instead of deploying a redis instance.
Thanks a lot for the PR!