-
Notifications
You must be signed in to change notification settings - Fork 137
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
The connection to a device in Eclipse Hono Sandbox is lost if a cloud application fails to process a message #3393
Comments
I am not sure if I understand correctly what you are trying to do. Usually, a back end application sends a command to a device and a device sends its response via the MQTT adapter to the back end application. Based on these assumptions, I would suspect that the AMQP message received by your Python script is not properly settling the message with the You might want to try to use QoS 0 instead of QoS 1 to publish the command response. In that case, the MQTT adapter simpy uses fire and forget semantics when sending the AMQP message to the downstream application. Another op |
@ognian-baruh any news on this? Can we close this issue? |
Hello @sophokles73, sorry for the late reply, but I have been away for the last week.
Yes, that is correct. The idea behind the simulation of the command response is to isolate it in order to be sure that this is exactly what is causing the issue.
After further tests, I came to the same conclusion and modified the script a little bit - when receiving the response I manually close the connection and I then kill the process in the
I tried out QoS 0 when publishing the command response and the client get disconnected again, but it is able to reestablish the connection right away. Also, after some observations I found out that this behavior only occurs when publishing command responses, but not when publishing events. Without any modifications to the script but subscribing to the events topic, I am able to receive the event and kill the process from within the |
That is because the command response message are being routed to the downstream consumer whereas the events are being brokered. The former means that the messages are being forwarded by the Dispatch Router to the consumer directly. The latter means that the Dispatch Router forwards the event message to an Artemis message broker which persists the message to a file. From the sender's point of view, the event has then be accepted by Hono (but not yet delivered to the consumer). The downstream consumer will then receive the event message from the Artemis broker, either immediately (if it is connected) or at any later time when it connects ... |
Thank you very much for the response, I think we can close the issue now, as it seems like everything is working as expected. |
Great, then please do so :-) |
I have created a tenant and a device and am explicitly setting the messaging type of the tenant to AMQP using the following creadentials:
The tenant and device are being provisioned using the following three commands:
I have created a simple Python script which creates a Command Response handler using the Qpid Proton library:
My aim is to exit the application as soon as a message is received. I am using MQTT Explorer to publish the response to the connected device. The message details are the following:
Topic:
command///res/024cc17e6bb-86d7-40a0-b1a8-8f741d750a01replies/200
Payload (JSON formatted):
{"example": "value"}
QoS: 1
When I publish the message, it gets received by the Python script and the script gets terminated as expected, but the MQTT Explorer gets disconnected from the device and it cannot connect again through its reconnect functionality. I am only able to reconnect if I disconnect manually beforehand.
Is it expected for the Eclipse Hono Sandbox to terminate the connection to the device when a cloud application has failed to process a message?
If yes, then why does the Eclipse Hono Sandbox accept the connection from the device afterwards?
The text was updated successfully, but these errors were encountered: