# Custom Feeder does not produce random values

**URL:** <https://community.gatling.io/t/custom-feeder-does-not-produce-random-values/4341>\
**Category:** Gatling (Open-Source)\
**Created:** [May 29, 2018, 2:33pm UTC](https://community.gatling.io/t/custom-feeder-does-not-produce-random-values/4341 "2018-05-29T14:33:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickshivhares29](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nickshivhares29](https://community.gatling.io/u/nickshivhares29)\
**Post date:** [May 29, 2018, 2:33pm UTC](https://community.gatling.io/t/custom-feeder-does-not-produce-random-values/4341/1 "2018-05-29T14:33:08Z")

</div>

Hi,

I have tried using custom feeder from example specified at  
[https://github.com/gatling/gatling/blob/master/src/sphinx/session/code/FeederSample.scala](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:**

```auto
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")))
 }
}

```

```auto

```

```auto

```

```auto
**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](http://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)  
}

---

<div class="post-metadata">

**Author:** ![Ignacio\_Degeneffe](https://avatars.discourse-cdn.com/v4/letter/i/e0b2c6/32.png) [@Ignacio\_Degeneffe](https://community.gatling.io/u/Ignacio_Degeneffe)\
**Post date:** [May 31, 2018, 7:23pm UTC](https://community.gatling.io/t/custom-feeder-does-not-produce-random-values/4341/2 "2018-05-31T19:23:13Z")

</div>

Put feed inside during block.

---

<div class="post-metadata">

**Author:** ![nickshivhares29](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nickshivhares29](https://community.gatling.io/u/nickshivhares29)\
**Post date:** [June 1, 2018, 2:11pm UTC](https://community.gatling.io/t/custom-feeder-does-not-produce-random-values/4341/3 "2018-06-01T14:11:16Z")

</div>

Thanks, it worked.

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