scala.NotImplementedError with Gatling+MQTT+Maven

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:

  1. I started from Gatling @slandelle example and it works fine: GitHub - gatling/gatling-maven-plugin-demo: Showcase of the Gatling Plugin for Maven
  2. 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

`

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.example
xyz-load-tests
1.0-SNAPSHOT

3.3.1 3.0.5 3.2.0 4.3.0 3.0.4 io.gatling.highcharts gatling-charts-highcharts ${gatling.version} test io.gatling gatling-app ${gatling.version} io.gatling gatling-recorder ${gatling.version} io.gatling gatling-mqtt ${gatling.version} ${project.basedir}/src/test/scala maven-jar-plugin ${maven-jar-plugin.version} net.alchim31.maven scala-maven-plugin ${scala-maven-plugin.version} testCompile -Xss100M -target:jvm-1.8 -deprecation -feature -unchecked -language:implicitConversions -language:postfixOps io.gatling gatling-maven-plugin ${gatling-plugin.version} ` **MqttStressSimulation:** ` package eu.xyz.tests.load

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.

As stated at the top of the Gatling MQTT documentation:

MQTT support is only available in FrontLine.

You can compile locally, but you can only run on FrontLine.

Thanks for your reply. The answer sped up my work.

Best regards, Michal B.

W dniu piątek, 3 stycznia 2020 15:58:27 UTC+1 użytkownik Stéphane Landelle napisał: