Share MQTT device client connection for multiple devices (SDK v2) #3056
WillooWisp
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
Hello @WillooWisp As you've indicated above, initializing thousands of client connections through a single .NET application does bring in the possibility of running into port exhaustion. What you'd want to do instead, is use multiplexing to multiplex multiple client sessions over the same connection. This feature, however, is available only over AMQP. MQTT v3.1 does not support multiplexing. In order to create a complete solution, there are a couple of ways you can implement identity translation through a gateway using the IoT SDK.
Let me know if you have any further questions. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wonder what the resource / performance implications might be when you have thousands of devices, each having it's own identity (device id) in the IoT hub for separation and authentication purposes, and therefore each having a device client of its own. This means that from a single .NET program thousands of MQTT connections will be initiated and kept alive, what about network resource exhaustion, is it a problem or not?
If this will become a problem, with many device clients, do you have any plans on being able to share a single device client and MQTT connection in the upcoming v2 of the Azure IoT SDK? E.g. creating a single device client for the gateway device itself, but then allow sending messages for each device (sensor) through the same device client, passing on device id and device key for authentication with the IoT hub.
A "shared" device client for multiple devices would also help with the throttling implications of the IoT hub related to new connections, file uploads and telemetry message quota.
Beta Was this translation helpful? Give feedback.
All reactions