// About
Kafka protocol plugin for Gatling. Produce-only and request-reply flows with plain serialization, Avro4s helpers and Schema Registry integration. Reply correlation is configured at the protocol level and tracked by a shared consumer.
// Highlights
- Produce-only via kafka("name").topic(...).send(...)
- Request-reply with matchByValue / matchByMessage correlation
- Avro4s + Schema Registry, or your own Kafka Serde[T]
- Gatling 3.13.5 · Scala 2.13.16 · Java 17+
// build.sbt
libraryDependencies += "org.galaxio" %% "gatling-kafka-plugin" % "<version>" % Test
import org.galaxio.gatling.kafka.Predef._
import io.gatling.core.Predef._
val kafkaConf = kafka
.properties(Map("bootstrap.servers" -> "localhost:9092"))
val scn = scenario("Kafka Producer")
.exec(
kafka("send message")
.topic("test-topic")
.send[String, String]("key", """{"msg": "hello"}""")
)
setUp(scn.inject(atOnceUsers(1))).protocols(kafkaConf)