Multiplexing Device-Connection via JAVA-SDK

Michael Mangeng 1 Reputation point
2020-09-03T15:11:27.737+00:00

Hi,

we want to connect an existing system with a field-gateway like structure to azure iot hub. Our system already registers devices in azure iot hub using DPS group enrollment. After the enrollment process, we want to:

  • Send/Receive messages to/from iot hub
  • Send/Receive DeviceTwin updates (reported/desired) properties.

Currently we are not able to figure out how this can be done using the java-sdk. We can see that we have to use the TransportClient via AMQP and then add all devices which are to be multiplexed through this connection. Nevertheless, we are not able to figure our what we have to supply as ConnectionString for the first (and the successive) devices.

Can somebody drop a hint or point us to an example/relevant documentation?

We've got more than 100K devices. Currently we can see that adding/removing devices while using the TransportClient is not possible. Therefore we intend to create clusters containing e.g. 1000 devices each so we have to restart only 1 cluster if a device is added/removed. If there are better possibilities, we would be glad to hear about!

greetings,
Michael

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
694 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
163 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Satish 13,631 Reputation points Microsoft Employee
    2020-09-03T22:56:53.84+00:00

    Hello @Michael Mangeng , Thanks for reaching out to us!

    I hope you have already referred to below Github sample code.

    [Device 1 connection string] - String containing Hostname, Device Id & Device Key in one of the following formats:
    HostName=<iothub_host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>\n"

    22484-image.png

    22468-image.png

    Please let us know if you need further help in this matter.