Comments (3)
@bennydiamond we have encountered a similar situation in our solution using MQTT protocol as well, here's our solution to adjust queues message timeout, you can adjust these values according to your needs but with this patch the queued messages will be flushed after 10 seconds with one resend retry after 5 seconds:
This lowers timeout and retry values since we do not want
messages to be kept in internal SDK message queue for too long
There is OPTION_MESSAGE_TIMEOUT that may be used in the SDK
but it is deprecated
--- a/iothub_client/src/iothubtransport_mqtt_common.c
+++ b/iothub_client/src/iothubtransport_mqtt_common.c
@@ -46,8 +46,8 @@
#define DEFAULT_CONNACK_TIMEOUT 30 // 30 seconds
#define BUILD_CONFIG_USERNAME 24
#define SAS_TOKEN_DEFAULT_LEN 10
-#define RESEND_TIMEOUT_VALUE_MIN 1*60
-#define TELEMETRY_MSG_TIMEOUT_MIN 2*60
+#define RESEND_TIMEOUT_VALUE_MIN 5
+#define TELEMETRY_MSG_TIMEOUT_MIN 10
#define DEFAULT_CONNECTION_INTERVAL 30
#define FAILED_CONN_BACKOFF_VALUE 5
#define STATUS_CODE_FAILURE_VALUE 500
Or instead of a patch the two values right here https://github.com/Azure/azure-iot-sdk-c/blob/main/iothub_client/src/iothubtransport_mqtt_common.c#L50-L49
Do note that this may be considered a workaround for such problem but it suited our needs
from azure-iot-sdk-c.
connection and messaging reliability is documented here
We might have come into a situation where some devices have spotty communication with the cloud and outgoing messages (Device to cloud) are getting stuck and accumulated in doubly linked lists to the point the device runs out of memory
This SDK does not implement a max queue size as that is best determined by the application and platform requirements. You would need to implement an application dependent queue to be handle your application needs for messaging and monitor the sending of the messages and their corresponding status callbacks.
Normal operation of the SDK will temporarily hold on to the message and try to reconnect to the hub if disconnected due to infrastructure issue.
Connection Retry Policies can be set to application specific needs.
from azure-iot-sdk-c.
Closing this issue based on the last comment from @ericwol-msft
Please feel free to reopen it or open a new one if you would like to follow up.
Thanks,
Azure IoT SDK Team
from azure-iot-sdk-c.
Related Issues (20)
- Does this SDK client support empty proxy username and password? HOT 2
- Version 1.12.0 does not have a git tag HOT 8
- IoTHubDeviceClient_UploadMultipleBlocksToBlob_Async can miss some errors HOT 14
- Async responses for Direct Methods HOT 11
- Azure SDK unreliably connecting to IoT Hub. Error reason: IOTHUB_CLIENT_CONNECTION_NO_NETWORK HOT 6
- Is it possible to connect a real robot (as a device client) to an IoT hub? HOT 3
- The version of the Provisioning API is not up to date HOT 2
- Does MQTT_Websockets support SAS authentication? HOT 2
- Convenience function DM callback
- Segmentation fault when uploading to blob on arm32 HOT 5
- LogError with null as a string (%s) HOT 13
- unit tests rely on unspecified order-of-evaluation bahavior HOT 2
- Segmentation fault during device to cloud message HOT 9
- LTS_03_2024 release/tag not part of lts_03_2024 branch HOT 2
- Provisioning with X509 doesn't work on windows HOT 1
- It's not possible to create a client device handle using Transport or Auth HOT 2
- A way to query IoT Hub from device and get response? HOT 5
- IoTHubDeviceClient_CreateFromDeviceAuth() using symmetric key attestation issue HOT 2
- Required ENV variables for C Iot Edge Module HOT 2
- SAS request error for blob upload cannot be handled HOT 3
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 azure-iot-sdk-c.