Hi, I’m using gatling 2 M3. Everything seems to be working fine except when I try to use my custom feeder.
object File2Json extends Feeder[String] {
val feedIter = readCsvInStream.iterator //I can’t use feeder(‘path’).csv because i’m doing a lot more work to compose data
override def next(): Map[String, String] = {
val next = feedIter.next()
val json: String = next.toJson
Map(“payload” → json)
}
override def hasNext: Boolean = feedIter.hasNext
}
val scen = scenario(“Load on server”)
.feed(File2Json)
.exec(
http(“post first round of requests”)
.post("/restEndPoint")
.headers(httpHeaders)
// .body() //what exactly to do here?
.check(status.is(200))
)
setUp(scen.inject(nothingFor(2 seconds), ramp(200 users) over (120 seconds))).protocols(httpConf)
How do I pull the “payload” data (which is simply a String) into each execution cycle as an http request body?