Use a function to generate a Gatling feeder

499 Views Asked by At

I'm using Gatling 3.3.1 to inject data in Kafka using the gatling-kafka library. I'm trying to use a small custom feeder to test it.

  val feeder = Iterator.continually(Map("email" -> (Random.alphanumeric.take(20).mkString + "@foo.com")))
  val scn: ScenarioBuilder = scenario("Kafka Test")
  .feed(feeder)
.exec(
  kafka("request")
    .send[String]("${email}")
)

But it doesn't work feed() expects a FeederBuilder an feeder is Iterator[Map[String,String]]

I don't know how is the correct way to fix / do this.

1

There are 1 best solutions below

1
On

It compiles properly on my side. I recommend you try with an up-to-date version of Gatling. The current one is 3.4.2 and 3.5.0 will be out next week.