-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT 5 messages sent when Ditto was not connected are not processed #1767
Comments
I've sent 1 message while connection was closed. Here are logs from mosquitto when I send command openConnection:
According to the logs, messages are delivered and acknowledged before Ditto subscribes to topics. My guess is that it is how MQTT 5 protocol works - when you connect to existing session, you get messages, that are awaiting for you, right after the connection is established. Another strange thing is the first 2 lines - some connection is opened and closed before connection with client ID ditto is established. The last one strange thing is that Ditto subscribes twice for each topic. Those strange things are definitely out of scope of this ticket, but they might provide some clue. |
Hi @dimabarbul . Maybe both issues share the problem with more than 1 source? |
Unfortunately, this happens when there is only one source as well. |
Both issues are likely bugs in Ditto's MQTT implementation. We also faced some problems with the HiveMQ MQTT client, e.g.: hivemq/hivemq-mqtt-client#544 Unfortunately, the Ditto committer who is most experienced on the MQTT implementation is no longer contributing actively to Ditto and I currently don't find time to deep dive into it as well. So I will mark the issues as "help wanted" and hope for contributions. |
As the changes are quite risky, it would be great to cover existing and new functionality with tests that ensures correct work with real mqtt broker (I can't think of a way to test this using unit tests), so I'd like to have an integration or system test:
I'd like the first approach, because integration test would be faster and we'd be able to cover more scenarios. I see that there is test code that launches mongo DB, so it looks okay to have such kind of tests. Also having tests in this repo will confirm that the functionality works as expected when doing later changes by running PR checks, without need to remember to run system tests manually. @thjaeckle , what do you think will be better approach? |
@dimabarbul I would normally use the The colleagues from Bosch still have an internal CI where they can run the tests. Locally, you should be able to run the tests as well - however the system-tests for the "connectivity" part of Ditto are quite complex (with a lot of inheritance), so it is also not quite easy .. Therefore an integration test, spinning up an MQTT broker, would likely be the easier approach. |
Messages that are sent to MQTT 5 broker (I used mosquitto) are delivered to Ditto, but are not processed.
Setup:
Steps:
Connection I used to test:
Messages I sent:
The text was updated successfully, but these errors were encountered: