novastone-media / MQTT-Client-Framework

iOS, macOS, tvOS native ObjectiveC MQTT Client Framework
Other
1.84k stars 466 forks source link

unable to create separate connections while running multiple Vusers in loadrunner #434

Closed yshnr1010 closed 6 years ago

yshnr1010 commented 6 years ago

we are unable to create multiple connections for multiple VUSERS running in controller . we are seeing the below error: "Server closed the connection. Probably, another client with Client ID 'mimic2/mqtt/#' has just connected, or the server doesn't support the passed parameters."

see my LR script below and suggest any changes needed

vuser_init() {     lr_start_transaction("login");

    / Declared in "globals.h" /     client = mqtt_create();               mqtt_set_client_id(client, "mimic2/mqtt/#");          //mqtt_set_credentials(client, "", "<12345>");     mqtt_set_lwt(client, "BCDS/#", "", MQTT_AUTO, MQTT_DEFAULT, MQTT_RETAIN);               / Connect to an MQTT broker /     mqtt_connect(client, "tcp://iot.eclipse.org");          / Uncomment the following if implementing the "subscriber" logic /     mqtt_subscribe(client, "BCDS/#");          lr_end_transaction("login", LR_AUTO);

         return 0;

please anyone see on this issue and reply to my mail "vayhehaar@gmail.com"

jcavar commented 6 years ago

You are not allowed to create multiple connections from client with same id.

yshnr1010 commented 6 years ago

we have changed the cliend ID's and tried... it was successfully running in VUGEN. but when we add more than one VUSERS in controller and run ,then first vuser gets disconnected and second user gets connected and the disconnected VUSER will be appearing under failed section..

jcavar commented 6 years ago

Are those users using same client id?

yshnr1010 commented 6 years ago

yes, they are using the same client ID .. how can we make Vuser use the Different CLient ID specified in the script below:

    vuser_init() {     lr_start_transaction("login");

    / Declared in "globals.h" /     client1 = mqtt_create();     client2 = mqtt_create();              mqtt_set_client_id(client1, "mimic2/mqtt/1");     mqtt_set_client_id(client2, "mimic2/mqtt/2");     // mqtt_set_credentials(client, "", "");     mqtt_set_lwt(client1, "BCDS/#", "", MQTT_AUTO, MQTT_DEFAULT, MQTT_RETAIN);     mqtt_set_lwt(client2, "BCDS/#", "", MQTT_AUTO, MQTT_DEFAULT, MQTT_RETAIN);

/ Connect to an MQTT broker /     mqtt_connect(client1, "tcp://iot.eclipse.org");     mqtt_connect(client2, "tcp://iot.eclipse.org");          / Uncomment the following if implementing the "subscriber" logic /     mqtt_subscribe(client1, "BCDS/#");     mqtt_subscribe(client2, "BCDS/#");          lr_end_transaction("login", LR_AUTO);     return 0; }

jcavar commented 6 years ago

I am not familiar with your framework but I assume you need to invoke vuser_init with different client id.

yshnr1010 commented 6 years ago

with which framework are you familiar.. and how would you use two or more VUSERS and run the script

jcavar commented 6 years ago

Are you using MQTT-Client-Framework? Because from your code it seems like it is something else.

yshnr1010 commented 6 years ago

yeah MQTT.. we are using GAMBIT simulator and hiveMQ as broker

jcavar commented 6 years ago

Yeah so not this client framework. I am not familiar with GAMBIT or hiveMQ either.

yshnr1010 commented 6 years ago

can you suggest which simulator and broker will be best for the IOT performance testing

jcavar commented 6 years ago

I can't unfortunately. I have no experience with IOT.

yshnr1010 commented 6 years ago

thanks for the help