# Not able to use Gatling Feeder to generate random data

**URL:** https://community.gatling.io/t/not-able-to-use-gatling-feeder-to-generate-random-data/3842
**Category:** Gatling (Open-Source)
**Created:** [July 23, 2017, 12:57am UTC](https://community.gatling.io/t/not-able-to-use-gatling-feeder-to-generate-random-data/3842 "2017-07-23T00:57:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Abhishek\_Srivastava](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Abhishek\_Srivastava](https://community.gatling.io/u/Abhishek_Srivastava)
#### Post date: [July 23, 2017, 12:57am UTC](https://community.gatling.io/t/not-able-to-use-gatling-feeder-to-generate-random-data/3842/1 "2017-07-23T00:57:48Z")

</div>

I wrote this simple test in Gatling

```auto
val createUser = http("create user")
  .post("form/submit")
  .body(StringBody(RequestBuilder.createRandomUser())).asJSON
  .check(status.is(200))

setUp(
  scn.inject(
     atOnceUsers(25),
     rampUsers(10) over (5 seconds),
     constantUsersPerSec(30) during(10 minutes)
  )
).protocols(httpConf)

```

I tested the createRandomUser method for more than 10000 calls and it always generated random users.

But this code when Run inside of Gatling, starts complaining duplicate users in just 10 seconds of run

What I suspect is that each user in Gatling calls my random method once, but THEN re-uses the same object.

I did some googling and found Feeders

[http://gatling.io/docs/current/session/feeder/](http://gatling.io/docs/current/session/feeder/)

```auto
val feeder = Iterator.continually(Map("user" -> 
    (RequestBuilder. createRandomUser(emails))))

```

val createUser = http(“create user”) .post(“form/submit”) .body(StringBody(feed(feeder))).asJSON .check(status.is(200))

but this doesn’t work.

How can I make sure that everytime a request is made … my random data method is called.

Also posted this question here

[https://stackoverflow.com/questions/45247478/gatling-not-able-to-use-my-random-data-generator](https://stackoverflow.com/questions/45247478/gatling-not-able-to-use-my-random-data-generator)

---

<div class="post-metadata">

### Author: ![Abhishek\_Srivastava](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Abhishek\_Srivastava](https://community.gatling.io/u/Abhishek_Srivastava)
#### Post date: [July 23, 2017, 12:59am UTC](https://community.gatling.io/t/not-able-to-use-gatling-feeder-to-generate-random-data/3842/2 "2017-07-23T00:59:08Z")

</div>

I am using Gatling SBT Plugin 2.2.0
