hemikak / mqtt-jmeter

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

Want to know how this plugin works.. #4

Closed arbazalam2z closed 7 years ago

arbazalam2z commented 8 years ago

Hi Hemikak,

I have a scenario in which i have suppose to send 20 messages and after each message sent connection should be disconnect and again connect to send next message. Does this plugin serve my purpose. I also would like to know how this code works.

Thanks Arbaz

hemikak commented 8 years ago

Hi @arbazalam2z , Sorry this does not support requirement. The same issue is there with JMS sampler as I know.

But you can use the following options below. You will have to create 20 thread groups. Each thread will send 1 message. The threads will be consecutively executed once you have done the change to the "TestPlan"

[1] - http://stackoverflow.com/questions/14321662/running-multiple-thread-groups-sequentially-in-jmeter [2] - http://jmeter.apache.org/usermanual/component_reference.html#Test_Plan

Regards, Hemika

arbazalam2z commented 8 years ago

Actually i have to deal with 50K message per minute, in that case threading concept of JMETER will not work. What if i can introduce diconnect() function in the code?

hemikak commented 8 years ago

Is this only for publisher side? or are looking for subscriber side as well ?

arbazalam2z commented 8 years ago

Thanks for quick reply.. :+1:

Yes it is for publisher side only.

hemikak commented 8 years ago

Hi @arbazalam2z ,

Try out the attached diff. Only tested it a bit. You will have to changed the extension to 'diff' from 'txt'.

mqtt-publisher-non-caching.txt

hemikak commented 8 years ago

Please close this issue if the above patch resolves the issue. Please note that I wont be merging the patch at the moment.

hemikak commented 8 years ago

@arbazalam2z was it that the patch could not be properly patched ?

The implementation was that for each sample a client gets created , published and then destroyed.

is your requirement to use the same client to connect, publish and disconnect ?

arbazalam2z commented 8 years ago

@hemikak As per my requirement it is not necessary that client should be same, it may be different either. I have patched it properly. If possible please upload complete zip or email me at: handsomearbaz@gmail.com

Thanks, your help is really appreciated... :+1:

anandsb123 commented 8 years ago

Hi Hemikak , Thanks for the MQTT pluggin for jmeter ,Can you provide me sample Jmeter script ,So that i can get some idea on how to use this pluggin , Appreciate quick response

hemikak commented 7 years ago

@anandsb123 Sorry for the delay, I will get back to you on it soon.

hemikak commented 7 years ago

Hi @anandsb123, Rename the extensions to jmx.

MQTT Publisher.txt MQTT Subscriber.txt

ninjin274 commented 7 years ago

Hi,

I am getting following error. Can you help me?

jmeter.threads.JMeterThread: Error while processing sampler 'MQTT Publisher' : java.lang.NullPointerException at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:457) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.(MqttAsyncClient.java:273) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.(MqttAsyncClient.java:167) at org.eclipse.paho.client.mqttv3.MqttClient.(MqttClient.java:224) at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.(BlockingClient.java:91) at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.initClient(PublisherSampler.java:259) at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.sample(PublisherSampler.java:286) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)

kaushalkumarjha23 commented 6 years ago

@arbazalam2z Hi,I have a similar requirement as yours so want to know if your code worked. Also if it has worked for you can you please provide me the final code that worked for you on kaushalkrjha@gmail.com

PareshSolankiMI commented 6 years ago

Hello All, Can you please help me where to show my subscription channel responses?