Hello,
I’m trying to do a MQTT load test with gatling-mqtt plugin. Normally I’m a Java developer that’s why I used the Maven with IntelliJ IDE. The app throws an error “scala.NotImplementedError”. Desc:
- I started from Gatling @slandelle example and it works fine: GitHub - gatling/gatling-maven-plugin-demo: Showcase of the Gatling Plugin for Maven
- After adding gatling-mqtt and and performing several configurations compilation fail with scala.NotImplementedError.
Stack trace:
[INFO] --- gatling-maven-plugin:3.0.5:test (default-cli) @ xyz-load-tests --- 14:40:57.590 [ERROR] i.g.a.Gatling$ - Run crashed scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:288) at io.gatling.mqtt.check.MqttCheckSupport.$init$(MqttCheckSupport.scala:38) at io.gatling.mqtt.Predef$.<init>(Predef.scala:28) at io.gatling.mqtt.Predef$.<clinit>(Predef.scala) at eu.xyz.tests.load.MqttStressSimulation.<init>(MqttStressSimulation.scala:10) ... 16 common frames omitted Wrapped by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at io.gatling.app.Runner.run0(Runner.scala:74) at io.gatling.app.Runner.run(Runner.scala:60) at io.gatling.app.Gatling$.start(Gatling.scala:80) at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46) at io.gatling.app.Gatling$.main(Gatling.scala:38) at io.gatling.app.Gatling.main(Gatling.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50) at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50) at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at io.gatling.app.Runner.run0(Runner.scala:74) at io.gatling.app.Runner.run(Runner.scala:60) at io.gatling.app.Gatling$.start(Gatling.scala:80) at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46) at io.gatling.app.Gatling$.main(Gatling.scala:38) at io.gatling.app.Gatling.main(Gatling.scala) ... 6 more Caused by: scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:288) at io.gatling.mqtt.check.MqttCheckSupport.$init$(MqttCheckSupport.scala:38) at io.gatling.mqtt.Predef$.<init>(Predef.scala:28) at io.gatling.mqtt.Predef$.<clinit>(Predef.scala) at eu.xyz.tests.load.MqttStressSimulation.<init>(MqttStressSimulation.scala:10) ... 16 more
pom.xml
`
4.0.0
org.example
xyz-load-tests
1.0-SNAPSHOT
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.mqtt.Predef._
class MqttStressSimulation extends Simulation {
private val mqttConf = mqtt
.broker(“localhost”, 1305)
private val scn = scenario(“MQTT Test”)
.exec(mqtt(“Connecting”).connect)
.exec(
mqtt(“Publishing”)
.publish(“drill/ABC-001/engine/temperature/1”)
.message(StringBody(“99”))
.expect(100 milliseconds)
)
.exec(waitForMessages.timeout(100 milliseconds))
setUp(scn.inject(atOnceUsers(1))).protocols(mqttConf);
}
`
Others: Engine, IDEPathHelper, Recorder(except simulationPackage) remained the same as in the example.
Does anyone have an idea where the problem might be?
Best regards, Michal B.