gatling-kafka-plugin icon indicating copy to clipboard operation
gatling-kafka-plugin copied to clipboard

Using session attributes inside the avro object builder

Open s-danilov opened this issue 3 years ago • 2 comments

Hi there, Could you please add the ability to use session attributes in the avro object builder. For example, I use this code

exec( _.set("text", "Hello"))
.exec(
 kafka("incomeMsg")
 .send("myTopic",
           AvroObject
             .newBuilder()
             .setMessage("${text}")
             .build())
       ) 

I expect that the instance of AvroObject will contain field "Message"="Hello", but it's equal to "${text}", like String

s-danilov avatar Jun 01 '21 13:06 s-danilov

Hi, I am facing similar issue when trying to use feeder for kafka messages. This is my example code:

val feeder = Array(
    Map("foo" -> "foo1", "bar" -> "bar1"),
    Map("foo" -> "foo2", "bar" -> "bar2"),
    Map("foo" -> "foo3", "bar" -> "bar3")
  ).random

  val scn = scenario("Kafka Test")
    .feed(feeder)
    .exec(kafka("request")
      .send[String, String]("${foo}", "${bar}"))

In the topic I get "${foo}" for key and "${bar}" for value, instead of their values from feeder (foo1, bar1 ... etc). Probably related to the issue described above.

Karamanoleff avatar Jun 15 '21 14:06 Karamanoleff

Hi, I am also facing the issue that I cannot inject random avro message to the send method. Do you have any information if a fix will be available soon?

fherling avatar Jan 31 '22 17:01 fherling