Custom Feeder does not produce random values

Hi,

I have tried using custom feeder from example specified at
https://github.com/gatling/gatling/blob/master/src/sphinx/session/code/FeederSample.scala

and it seems I am facing issue with it. Can you please help me to know if it is bug in gatling.

NOTE:
We have some other scenario but I have tried to explain it in a simple way.

We used custom feeders as:

Custom feeder Code:

import io.gatling.core.feeder.Feeder

import scala.util.Random

/**
 * Created by Shishir Shivhare on 14/05/18.
 */
object TestFeeder {

 def apply(): Feeder[String] = {
 Iterator.continually(Map("email" -> (Random.alphanumeric.take(20).mkString + "@foo.com")))
 }
}



**Code where custom feeder used:**

class TestRequest extends Simulation {

val httpConf = http.baseURL(“http://”).inferHtmlResources(
BlackList(
“”"..js""",
“”".
.css""",
“”"..gif""",
“”".
.jpeg""",
“”"..jpg""",
“”".
.ico""",
“”"..woff""",
“”".
.(t|o)tf""",
“”".*.png""" ), WhiteList())

val httpSampleRequest = http(“SampleRequest”)
.get(""“www.google.com”"")
.check(status.is(200))

val infoFeeder = TestFeeder()
val scn = scenario(getClass.getName)
.feed(infoFeeder)
.during(30) {
exec(httpSampleRequest)
.exec(
session => {
println(session(“email”).as[String])
session
}
)
}

setUp(
scn.inject(rampUsers(2) over 10)
).protocols(httpConf)
}

Put feed inside during block.

Thanks, it worked.

val infoFeeder = TestFeeder()
val scn = scenario(getClass.getName)
.during(30) {
feed(infoFeeder)
.exec(httpSampleRequest)
)
}