Redis feeder : ERROR io.gatling.core.controller.Controller - Simulation crashed

hi, I am trying to create a redis feeder and i am able to connect to RedisClientPool(“localhost”, 6379)

while running the code, I am getting error :

11:48:43.202 [gatling-1-1] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Start user #1
11:48:43.202 [gatling-1-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Start user #2
11:48:43.202 [gatling-1-3] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Start user #3
11:48:45.242 [GatlingSystem-akka.actor.default-dispatcher-4] DEBUG com.redis.RedisClient - C: *2\r\n$4\r\nLPOP\r\n$10\r\nmydatalist\r\n
11:48:45.260 [GatlingSystem-akka.actor.default-dispatcher-7] **ERROR io.gatling.core.controller.Controller - Simulation crashed**
java.lang.IllegalStateException: Feeder is now empty, stopping engine
	at io.gatling.core.action.FeedActor$$anonfun$receive$1.applyOrElse(FeedActor.scala:60)
	at akka.actor.Actor.aroundReceive(Actor.scala:537)
	at akka.actor.Actor.aroundReceive$(Actor.scala:535)
	at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:25)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580)
	at akka.actor.ActorCell.invoke(ActorCell.scala:548)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
	at akka.dispatch.Mailbox.run(Mailbox.scala:231)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
11:48:45.263 [GatlingSystem-akka.actor.default-dispatcher-7] DEBUG io.gatling.core.controller.Controller - Ignore message Crash(java.lang.IllegalStateException: Feeder is now empty, stopping engine) while waiting for resources to stop
11:48:45.266 [GatlingSystem-akka.actor.default-dispatcher-7] DEBUG io.gatling.core.controller.Controller - Ignore message Crash(java.lang.IllegalStateException: Feeder is now empty, stopping engine) while waiting for resources to stop
My code : 
import com.redis._
import io.gatling.redis.Predef._
import io.gatling.redis.feeder.RedisFeederBuilder
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.core.scenario.Simulation

class redisFeederTest extends Simulation{

  // protocol
  val httpProtocol = http.baseUrl("http://computer-database.gatling.io/")
  val dataFeederPool = new RedisClientPool("localhost", 6379)
  val myDataFeeder: RedisFeederBuilder =
    redisFeeder(dataFeederPool, "mydatalist")

  val Scn = scenario("Post an item")
    .pause(2)
    .feed(myDataFeeder)

  //setup
  setUp(Scn.inject(atOnceUsers(3)))

}

Kindly help to resolve this issue.

Feeder is now empty, stopping engine . When the feeder is empty, gatling will error out. LPOP is not a blocking queue.Check if your redis queue has items in there.

If you want to use a circular list (that is you want to keep reusing the values in the queue) and you are on gatling 3.8 you may use RPOPLPUSH.

redisFeeder(redisPool, "foo", "foo").RPOPLPUSH
1 Like

HI @shoaib42 , Thanks for your input.