# Custom feeder and multiple scenaro

**URL:** <https://community.gatling.io/t/custom-feeder-and-multiple-scenaro/285>\
**Category:** Gatling (Open-Source)\
**Created:** [February 28, 2013, 10:52am UTC](https://community.gatling.io/t/custom-feeder-and-multiple-scenaro/285 "2013-02-28T10:52:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mickael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mickael](https://community.gatling.io/u/Mickael)\
**Post date:** [February 28, 2013, 10:52am UTC](https://community.gatling.io/t/custom-feeder-and-multiple-scenaro/285/1 "2013-02-28T10:52:41Z")

</div>

Hi all,

I’m using gatling to create a scenario with 4 http exec and a custom feeder to generate fake UDDID.

object FeederApi {  
val emeiFeeder = new Feeder[String] {

override def hasNext = true

override def next: Map[String, String] = {  
Map(“emei” → scala.math.abs(java.util.UUID.randomUUID.getMostSignificantBits).toString())  
}  
}  
}

val scnMobile = scenario(“load Test”)  
.feed(Array(FeederApi.emeiFeeder.next).circular)  
.exec(  
http(“request\_1”)  
.get(“[http://url1](http://url1)”)  
.queryParam(“emei”, “${emei}”)  
.headers(headers\_1)  
.check(status.is(200)))  
.pause(0 milliseconds, 0 milliseconds)  
.exec(  
http(“request\_2”)  
.get("/url2.php")  
.queryParam(“emei”, “${emei}”)  
.headers(headers\_1)  
.check(status.is(200)))  
.pause(0 milliseconds, 0 milliseconds)  
.exec(  
http(“request\_3”)  
.get("/url3.php")  
.queryParam(“emei”, “${emei}”)  
.headers(headers\_1)  
.check(status.is(302)))  
.pause(1000 milliseconds, 3000 milliseconds)  
.exec(  
http(“request\_4”)  
.get("/url4.php")  
.queryParam(“emei”, “${emei}”)  
.headers(headers\_1)  
.check(status.is(302)))

setUp(  
scnMobile.users(3).ramp(0).protocolConfig(httpConf\_1)  
)

My problem come from the url is build with the same emei parameter for the 3 users instead to have 3 urls with 3 differents emei parameter for the 3 users.

I think i’ve made a mistake but i don’t know where.

If somebody could help me to resole my problem it will be great.

Thanks a lot.

Mickaël.

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [February 28, 2013, 10:57am UTC](https://community.gatling.io/t/custom-feeder-and-multiple-scenaro/285/2 "2013-02-28T10:57:46Z")

</div>

Hi,

feed() take a feeder once and for all.

You’re converting your FeederApi.emeiFeeder into a new circular Feeder that has only one value (the one coming from the only time FeederApi.emeiFeeder.next is called).

You just have to pass your original feeder:

feed(FeederApi.emeiFeeder)

Cheers,

Stéphane

---

<div class="post-metadata">

**Author:** ![Mickael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mickael](https://community.gatling.io/u/Mickael)\
**Post date:** [February 28, 2013, 10:59am UTC](https://community.gatling.io/t/custom-feeder-and-multiple-scenaro/285/3 "2013-02-28T10:59:55Z")

</div>

Stephane,

Thanks a lot it’s working.

I need to read again the documentation 😉

Mickaël.
