Project Setup
Learn how to set up your project to use the Gatling MQTT protocol.
Understand the license and limitations
The Gatling MQTT component is distributed under the Gatling Enterprise Component License.
The Gatling MQTT protocol can be used with both the Community Edition and Enterprise versions of Gatling.
Its usage is unlimited when running tests on Gatling Enterprise. When used with Gatling Community Edition, usage is limited to:
- 5 users maximum
- 5 minute duration tests
Limits after which the test will stop. This means that all locally executed tests using the MQTT protocol are limited by these values. When the test stops, Gatling logs which limit it exceeded.
Get started with the demo project
A demo project is available for each supported language and build tool:
- Java with Gradle
- Java with Maven
- Kotlin with Gradle
- Kotlin with Maven
- Scala with sbt
- JavaScript
- TypeScript
Add the Gatling MQTT dependency
The Gatling MQTT plugin isn’t included with Gatling by default. Add the Gatling MQTT dependency, in addition to the usual Gatling dependencies.
The Gatling MQTT plugin was introduced in Gatling 3.10 and isn’t compatible with older versions.
For Java or Kotlin:
<dependencies>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-mqtt-java</artifactId>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Base Gatling setup for Maven is documented here.
dependencies {
gatlingImplementation("io.gatling:gatling-mqtt-java:3.16.1")
}
Base Gatling setup for Gradle is documented here.
For JavaScript/TypeScript:
npm install @gatling.io/mqtt@3.16.102
For Scala:
<dependencies>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-mqtt</artifactId>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Base Gatling setup for Maven is documented here.
dependencies {
gatlingImplementation("io.gatling:gatling-mqtt:3.16.1")
}
Base Gatling setup for Gradle is documented here.
libraryDependencies += "io.gatling" % "gatling-mqtt" % "3.16.1" % "test,it"
Base Gatling setup for sbt is documented here.