问题
I need to load test, web socket J2EE Application serving mobile client. The mobile client uses MQTT over web socket protocol. Listing down the features :
i) The mobile client connects to the web socket end point. ii) Hence forth it then send the binary data in MQTT packets.
Looking at JMeter to load test it. Using the following JMeter plugin. https://github.com/tuanhiep/mqttjmeter
I use the MQTT Connect sampler and change the protocol to 'ws' and port to '8080'. When I try to connect, I do not see any standard websocket request being sent. Tomcat (J2EE Server) send a 502 status code.
Any help in this regard will be highly appreciated.
回答1:
This plugin is using fusesource mqtt client library under the hood which supports TCP and eventually SSL and TLS protocols, you won't be able to load test your MQTT broker using WebSocket transport with this plugin
Consider switching to JMeter WebSocket Samplers, once you establish the connection you will be able to send whatever payload your mobile clients are sending.
More information: JMeter WebSocket Samplers - A Practical Guide
来源:https://stackoverflow.com/questions/65181976/testing-a-mqtt-client-using-jmeter