Search code examples
jmeterjmx

Run MQTT with 1 connect and multiple concurrent publish


I am trying to sending multiple publish to a MQTT broker concurrently from Jmeter. What I wanted to implement is as follows

  1. 1-MQTT Connect
  2. 100-MQTT Publish concurrently
  3. 1-MQTT Disconnect.

I tried adding the above 3 in different thread groups, On execution I am getting "Connection not found" in the 2nd Thread group containing the publish part. I am using a csv data set config for getting the data to be published.

Please let me know if there is any alternative way to simulate the same in jmeter


Solution

  • I resolved the above By setting the connection property as a JMeter Property So this is what I did, according to my test iterations 1. I created multiple connections numbering equal to the test count 2. Set those connections as property 3. Created Next thread group that will take all these connections and do MQTT publish concurrently

    The property setting I did using BeanPostProcessor