softwaremill / gatling-zeromq   0.1.0

Apache License 2.0 GitHub

A Gatling stress test plugin for ZeroMQ protocol

Scala versions: 2.11

gatling-zeromq

Build Status Maven Central Dependencies

Goal of the project

The aim of the project is to allow load testing of applications using ZeroMQ with the help of the Gatling tool.

Adding gatling-zeromq to your project

SBT dependency:

"com.softwaremill.gatling-zeromq" %% "gatling-zeromq" % "0.1.0"

Gradle dependency:

"com.softwaremill.gatling-zeromq:gatling-zeromq_2.11:0.1.0"

gatling-zeromq is available for Scala 2.11 and requires Java 8.

You need to add a dependency on Gatling tool to your project since it is not bundled in this library.

Running tests

Tests in the project can be started with:

sbt gatling:test

For more information look at the Gatling SBT plugin.

ZeroMQ connector

The project uses JeroMQ as the ZeroMQ connector.

Configuration

Before running a scenario, you have to provide host and port to connect to. For example:

  val config = zmqConfig
    .host("localhost")
    .port("8916")

Message patterns

The plugin supports:

  • the publishing side of the PUB-SUB pattern (zmqPub("...")),
  • the requesting side of the REQ-REP pattern (zmqReq("...")),
  • and the pushing side of the PUSH-PULL pattern (zmqPush("...")),

Sending data

Sending of a message and a multi-part message is supported:

scenario("Scenario A")
    .exec(
        zmqPub("a request")
            .send("a message")
    )

scenario("Scenario B")
    .exec(
        zmqPub("a request")
            .sendMore("a multi")
            .sendMore("part")
            .send("message")
    )

Types of data can be String, Array[Byte], numeric ones and Gatling's Expression Language strings as well.

Contributing

Take a look at the open issues and pick a task you'd like to work on!