Search code examples
jmetermqttazure-iot-hub

How to connect multiple MQTT clients to single iothub via JMeter


I am trying to establish connection of multiple MQTT clients to single azure server via JMeter.

Note: all client ID's & all username's are different but sharing the common password(SAS)

client ID-1 connection snapshot: enter image description here

clinet ID-2 connection snapshot: enter image description here

and it goes on..

Now the problem is when I run the in thread, first client only get connect : enter image description here

& the other clients connections are throwing the error:

enter image description here

Anyhelp would be grealy appreciated. Thanks.


Solution

  • JMeter executes Samplers upside down by each virtual user so you don't need to duplicate this Gateway Connect sampler, just define 2 threads (virtual users) in the Thread Group and each thread (virtual user) will execute Gateway Connect sampler and establish its own connection with the broker.

    The credentials can be parameterized using i.e. CSV Data Set Config so each virtual user would connect with its own username/password combination

    More information: Testing the MQTT Messaging Broker for IoT - A Guide