tuanhiep / mqttjmeter

This is the plugin for Jmeter to Test MQTT protocol
Apache License 2.0
86 stars 56 forks source link

MQTT Publisher & Subscriber - "Random Suffix" check box is checked #15

Open swapnilchintalwar opened 9 years ago

swapnilchintalwar commented 9 years ago

Hi,

In MQTT Publisher, the "Random Suffix" check box is checked whenever the script is opened, whereas i want the checkbox to be unchecked always.

In the MQTT Subscriber, the Cient ID field is able to retain the value but the Random Suffix is checked everytime i open the script although i made sure it is unchecked and the script is saved.

Please tell me why this issue occurs and also it would be great if you could tell me the purpose of the Random suffix checkbox.

Thanks, Swapnil

vraghavachari commented 8 years ago

Hi Swapnil,

I believe this is a bug in the code. Here is how I was able to fix it.

  1. Modify the MQTTPublisherGui.java file as below.
  2. Build and generate a new mqtt-jmeter.jar and place them in your JMETER/lib/ext folder.
  3. Reopen JMeter tool.

`public void configure(TestElement el) { .... mqttUser.setEnabled(useAuth.isSelected()); mqttPwd.setEnabled(useAuth.isSelected());

            //Adding the missing "Set" for the following UI elements.
    clientId.setText(sampler.getCLIENT_ID());
    suffixClientId.setSelected(sampler.useRandomSuffix());
    this.connectionPerTopic.setSelected(sampler.isOneConnectionPerTopic());

            ......

}`