grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
25.84k stars 1.27k forks source link

Support for MQTT protocol #1269

Open srimaln91 opened 4 years ago

srimaln91 commented 4 years ago

Hi,

It would be really valuable if we can use k6 to simulate MQTT pub/sub interfaces.

Thanks.

a-bendoraitis commented 3 years ago

Is there plan for MQTT support in k6? maybe there is plans to allow creating plugin architecture for different protocols? (in that case I think people would be happy to create open source plugins) No MQTT support for me means that I have to look at JMeter or Tsung, but I'd rather use k6 if there was a choice

na-- commented 3 years ago

k6 will probably natively support MQTT eventually, but I can't give any concrete estimates as to when, sorry. And speaking of plugins, yes, k6 already supports something like that, though we call them extensions. It's very likely that any MQTT module will start as an extension before we merge it into the core. Take a look at these links to learn more about extensions:

pmalhaire commented 3 years ago

I made a basic working mqtt extension here https://github.com/pmalhaire/xk6-mqtt

it lacks more metrics but publish / subscribe message is working

heliping commented 3 years ago

gatling already supports mqtt. expecting this feature.

pmalhaire commented 3 years ago

The xk6 team contacted me and they want to extend this extension. It works and it's tested for basic use. Comments and feature requests are welcome : https://github.com/pmalhaire/xk6-mqtt

a-bendoraitis commented 2 years ago

The xk6 team contacted me and they want to extend this extension. It works and it's tested for basic use. Comments and feature requests are welcome : https://github.com/pmalhaire/xk6-mqtt

We are using your extension to generate load, simulating thousands of IoT devices. MQTT works great, however we are having trouble with TLS. Can you comment what's the situation with TLS on the plugin side? Should it work out of the box?

pmalhaire commented 2 years ago

Hello, if you use a local TLS cert with custom CA there is a PR under merge on the subject. If you use a public TLS cert it should work out of the box, check your TLS cert chain. For exemple if you use docker and let's encrypt you may need to update certificate autorities.

pmalhaire commented 2 years ago

Don't hesitate to star the repo if you use it, it always helps.

pmalhaire commented 2 years ago

@arunasbend the local TLS MR has been merged, it is what you needed ?

drundanibel commented 1 year ago

@pmalhaire Basically a great approach from you! But it seems like there is still no support for user properties or other MQTTv5 features, right? So is this extension only for MQTTv3.1.1 and lower? Are there any plans to to move forward on this?

pmalhaire commented 1 year ago

@drundanibel I never needed MQTT v5. It won't be a lot of work to add it since it's supported by the undelying lib. Just a question of time and a bit of arch to keep backward compatibility.