Using multiple JDBC feeders in scenario

I’ve recently started out with Gatling (using Java), and I have a question regarding JDBCFeeders. I have several scenarios where I have to use more than one source of data, and wanted to know if it’s possible to use multiple sources to feed the necessary parameters in the request? And if so, how do I provide a cursor or target so that the feeder knows what paremeter to feed?

Here’s my code:

public static final ChainBuilder script = feed(Feeder.getData(“”))
.exec(http(“Submitting request”).put(“endpoint”)
.header(“Authorization”, “Bearer #{token}”)
“paremeter1” : “%s”,
“parameter2”: %d
“”" )).check(status().is(200)));

I thank you in advance for any help that could be provided.

Yes, of course, you can use multiple JDBC feeders.

Sorry, I don’t get your issue. Feeders inject (key, value) pairs in the Sessions where you insert feed in your scenario.

Thank you for replying. What I’m trying to do is build a structure of:

  • script (or basically the http request)
  • scenario
  • simulation

I’m doing this so I can have the responsibility of the tasks effectively delegated. So, in this particular case, I have a request that I’m going to submit and I need to assign values to the parameters in the request. I just wanted to know how to assign the value from the feeder to the appropriate parameter, since you’ve confirmed that more than one feeder can be used.

how to assign the value from the feeder to the appropriate parameter

This is not how things work. When you use data from the Session, you don’t know where it comes from (feeder, checks, manually put).

A feeder injects (key, value) pairs. With a JDBC feeder, the keys are the names of the columns in your SQL request (feel free to use AS n your SQL request to force different names).

1 Like

I see what you’re saying now. Thank you for pointing me in the right direction.