{"id":13651142,"url":"https://github.com/mnogu/gatling-mqtt","last_synced_at":"2026-01-10T12:46:15.975Z","repository":{"id":27204718,"uuid":"30675429","full_name":"mnogu/gatling-mqtt","owner":"mnogu","description":"A Gatling stress test plugin for MQTT","archived":true,"fork":false,"pushed_at":"2018-12-09T11:49:16.000Z","size":22,"stargazers_count":43,"open_issues_count":5,"forks_count":56,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T09:44:55.958Z","etag":null,"topics":["gatling","mqtt","stress-test"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnogu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T23:32:46.000Z","updated_at":"2023-11-28T11:22:06.000Z","dependencies_parsed_at":"2022-09-02T10:51:57.975Z","dependency_job_id":null,"html_url":"https://github.com/mnogu/gatling-mqtt","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnogu%2Fgatling-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnogu%2Fgatling-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnogu%2Fgatling-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnogu%2Fgatling-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnogu","download_url":"https://codeload.github.com/mnogu/gatling-mqtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333857,"owners_count":21413470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatling","mqtt","stress-test"],"created_at":"2024-08-02T02:00:45.665Z","updated_at":"2026-01-10T12:46:15.924Z","avatar_url":"https://github.com/mnogu.png","language":"Scala","funding_links":[],"categories":["Tools"],"sub_categories":["Plugins"],"readme":"# Gatling-MQTT\n\nAn unofficial [Gatling](http://gatling.io/) stress test plugin\nfor [MQTT](http://mqtt.org/).\n\n## Usage\n\n### Cloning this repository\n\n    $ git clone https://github.com/mnogu/gatling-mqtt.git\n    $ cd gatling-mqtt\n\n### Creating a jar file\n\nInstall [sbt](http://www.scala-sbt.org/) 0.13 if you don't have.\nAnd create a jar file:\n\n    $ sbt assembly\n\nIf you want to change the version of Gatling used to create a jar file,\nchange the following line in [`build.sbt`](build.sbt):\n\n```scala\n\"io.gatling\" % \"gatling-core\" % \"2.2.3\" % \"provided\",\n```\n\nand run `sbt assembly`.\n\n### Putting the jar file to lib directory\n\nPut the jar file to `lib` directory in Gatling:\n\n    $ cp target/scala-2.11/gatling-mqtt-assembly-*.jar /path/to/gatling-charts-highcharts-bundle-2.2.*/lib\n\n###  Creating a simulation file\n\n    $ cp gatling-mqtt/src/test/scala/com/github/mnogu/gatling/mqtt/test/MqttSimulation.scala /path/to/gatling-charts-highcharts-bundle-2.2.*/user-files/simulations\n    $ cd /path/to/gatling-charts-highcharts-bundle-2.2.*\n    $ vi user-files/simulations/MqttSimulation.scala\n\nThis plugin supports the following options:\n\n* host\n* clientId\n* cleanSession\n* keepAlive\n* userName\n* password\n* willTopic\n* willMessage\n* willQos\n* willRetain\n* version\n* connectAttemptsMax\n* reconnectAttemptsMax\n* reconnectDelay\n* reconnectDelayMax\n* reconnectBackOffMultiplier\n* receiveBufferSize\n* sendBufferSize\n* trafficClass\n* maxReadRate\n* maxWriteRate\n\nSee the document of [mqtt-client](https://github.com/fusesource/mqtt-client)\nfor the description of these options.\nFor example, the `host` option corresponds `setHost()` method in mqtt-client.\nThat is, you can obtain an option name in this plugin\nby removing `set` from a method name in mqtt-client\nand then making the first character lowercase.\n\nThe following options also support [Expression](http://gatling.io/docs/2.2.3/session/expression_el.html):\n\n* host\n* clientId\n* userName\n* password\n* willTopic\n* willMessage\n* version\n\nHere is a sample simulation file:\n\n```scala\nimport io.gatling.core.Predef._\nimport org.fusesource.mqtt.client.QoS\nimport scala.concurrent.duration._\n\nimport com.github.mnogu.gatling.mqtt.Predef._\n\nclass MqttSimulation extends Simulation {\n  val mqttConf = mqtt\n    // MQTT broker\n    .host(\"tcp://localhost:1883\")\n\n  val scn = scenario(\"MQTT Test\")\n    .exec(mqtt(\"request\")\n      // topic: \"foo\"\n      // payload: \"Hello\"\n      // QoS: AT_LEAST_ONCE\n      // retain: false\n      .publish(\"foo\", \"Hello\", QoS.AT_LEAST_ONCE, retain = false))\n\n  setUp(\n    scn\n      .inject(constantUsersPerSec(10) during(90 seconds)))\n    .protocols(mqttConf)\n}\n```\n\nThe following parameters of `publish()` support Expression:\n\n* topic\n* payload\n\nHere is a bit complex sample simulation file:\n\n```scala\nimport io.gatling.core.Predef._\nimport org.fusesource.mqtt.client.QoS\nimport scala.concurrent.duration._\n\nimport com.github.mnogu.gatling.mqtt.Predef._\n\nclass MqttSimulation extends Simulation {\n  val mqttConf = mqtt\n    .host(\"tcp://localhost:1883\")\n    // clientId: the values of \"client\" column in mqtt.csv\n    //\n    // See below for mqtt.csv.\n    .clientId(\"${client}\")\n\n  val scn = scenario(\"MQTT Test\")\n    // The content of mqtt.csv would be like this:\n    //\n    //   client,topic,payload\n    //   clientId1,topic1,payload1\n    //   clientId2,topic2,payload2\n    //   ...\n    .feed(csv(\"mqtt.csv\").circular)\n    .exec(mqtt(\"request\")\n      // topic: the values of \"topic\" column in mqtt.csv\n      // payload: the values of \"payload\" column in mqtt.csv\n      // QoS: AT_LEAST_ONCE\n      // retain: false\n      .publish(\"${topic}\", \"${payload}\", QoS.AT_LEAST_ONCE, retain = false))\n\n  setUp(\n    scn\n      .inject(constantUsersPerSec(10) during(90 seconds)))\n    .protocols(mqttConf)\n}\n```\n\n### Running a stress test\n\nAfter starting an MQTT broker, run a stress test:\n\n    $ bin/gatling.sh\n\n## License\n\nApache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnogu%2Fgatling-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnogu%2Fgatling-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnogu%2Fgatling-mqtt/lists"}