gatling-kafka-plugin
gatling-kafka-plugin copied to clipboard
Kafka header from feeder
Hi.
Is possible to send kafka headers from feeder in this plugin?
Need something like this:
.exec(kafka("my-topic").send[String,String]("{ \"kafka\": \"message\"", session => session("headers")))
It's possible to set a header from a session parameter like this
.exec(s => s.set("custom", new RecordHeaders().add("test-header", s("kekey").as[Array[Byte]])))
.exec(
kafka("BasicRequest")
.send[String, String]("foo", "foo", "#{custom}"),
)```
@3alster I tried as suggested in Java, but I am getting error as header is in string , expected is 'Header' format
Hi @partheebanMani, that's because you mixed up the types, just use RecordHeaders type instead of the Session for the headers variable.