Dynamic value into JDBC feeder

Hi Guys,

i’m creating random username to create a customer using a createUser api.

Now i need to login this customer with an otp.

im trying to fetch that otp from DataBase. i’m able to fetch the otp using below SQL only if the user name is hardcoded.

val feederdb = jdbcFeeder(“jdbc:mysql://xx.x.169.xxx/usfdbuser”, “username”, “pwd”, “select otp from customer_otp_history where id in (select max(id) from customer_otp_history where bu_id=42 and email_id=‘loaduser123@yopmail.com’ group by email_id)”)

i need to be able to fetch the otp for every customer registered and should pass his email into the JDBC feeder every time Dynamically.

right now im using this,

val feederdb = jdbcFeeder(“jdbc:mysql://xx.x.169.xxx/usfdbuser”, “username”, “pwd”, “select otp from customer_otp_history where id in (select max(id) from customer_otp_history where bu_id=42 and email_id=’${userName}’ group by email_id)”)

and getting the below exception

Exception in thread “main” java.lang.IllegalStateException: Feeder is now empty, stopping engine
at io.gatling.core.action.SingletonFeed$$anonfun$receive$1.applyOrElse(SingletonFeed.scala:61)
at akka.actor.Actor$class.aroundReceive(Actor.scala:484)
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:23)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Guys, can you help me out with this