Replies: 6 comments
-
Thanks for opening this. we expected OPTION_MESSAGE_TIMEOUT to be respected regardless of the client connection state. |
Beta Was this translation helpful? Give feedback.
-
By default the message timeout at the iothub_client layer is 0, disabling the timeout of telemetry messages by the iothub_client layer queued in the This is still fully controllable by the user by setting OPTION_MESSAGE_TIMEOUT right after creating the iothub client handle. So, OPTION_MESSAGE_TIMEOUT is respected regardless of the client connection state. My concern about changing the default telemetry timeout at the iothub_client layer is if it would break existing user applications. |
Beta Was this translation helpful? Give feedback.
-
So if I set OPTION_MESSAGE_TIMEOUT to 1 hour, can I expect the SDK to behave the same way - regardless of the client connection state? |
Beta Was this translation helpful? Give feedback.
-
I have not tried for 1 hour, but with 40 seconds this is what I get when not connected: Messages get put in the waitToSend queue ("Sending message X to IoTHub") at about 13:30:57
|
Beta Was this translation helpful? Give feedback.
-
Unfortunately, there is a different option for setting the message timeout if using AMQP protocol: "event_send_timeout_secs" And in MQTT the message timeout is hardcoded. Tying OPTION_MESSAGE_TIMEOUT to the transports would be a breaking change. Example: customer already sets a OPTION_MESSAGE_TIMEOUT to 1 minute, but waits longer (say, 10 minutes) if the AMQP transport is trying to resend the message. |
Beta Was this translation helpful? Give feedback.
-
right. I suspect apps that use the SDK may have a bug they aren't aware of if they don't set the OPTION_MESSAGE_TIMEOUT.
With current behaviour, customer will get 10 minutes timeout on message before SDK discovers it's disconnected, then next messages will have 1 minute timeout - correct? I'm not sure this behaviour is usable. plus currently if customer didn't set OPTION_MESSAGE_TIMEOUT and SDK is disconnected, there is no callback called on app which can cause many issues. wdyt of the following logic:
This will result in consistent behavior. set OPTION_MESSAGE_TIMEOUT to something by default - or do not queue at all if OPTION_MESSAGE_TIMEOUT not set - call app cb with error immediately if in disconnected state. |
Beta Was this translation helpful? Give feedback.
-
Development Machine, OS, Compiler (and Other Relevant Toolchain Info)
Any.
SDK Version (Please Give Commit SHA if Manually Compiling)
LTS 01/2023
Protocol
Any.
Describe the Bug
If the iothub_client is not connected, telemetry messages added to the queue do not timeout.
Only when the client is connected and messages have been attempted to be sent at least once they timeout if sitting in the queue for too long (4 minutes?).
The expected behavior should be the same if the client ever connects or not, timing out telemetry messages if they sit in the queue for too long.
Filed on behalf of @shmulikpeled
Beta Was this translation helpful? Give feedback.
All reactions