Mixing a feeder, an ELFileBody and Session API doesnt replace a value

From this comment, to clean up my simulation definition (as suggested at https://github.com/gatling/gatling/issues/2365#issuecomment-62906708), when trying to set a session attribute to a value (read from a system property) an EL attribute doesnt seem to been picked, and the request being sent is:

{“name”:"${JDBCDS}",“properties”:{“userName”:“user”,“password”:“password”}}

Find a sample project here:

https://github.com/witokondoria/gatlingELtest

request-bodies/sources_placeholders.json:3 contains the expression expected to be replaced and simulations/tests/PrePT.scala:29 is where the attribute is set.

This was tested with gatling-charts-highcharts-bundle-2.1.0-20141113.230508-72-bundle

val feeder = jsonFile("…/user-files/request-bodies/sources_placeholders.json")

Feeders files go in data, not request-bodies:
val feeder = jsonFile(“sources_placeholders.json”)

EL attribute doesnt seem to been picked
You can’t have EL expressions in feeder files, those are not templates.

Then, where do you plan on using this value? You don’t using anywhere for now.

Feeders files go in data, not request-bodies:
To be fair, my real life example is a mavenized project and the structure differs from what has been uploaded, but will remember this

You can’t have EL expressions in feeder files, those are not templates.
But this feeder file feeds a ELFileBody, so I would expect this steps:

· a json feeder reads each entry at sources_placeholders.json and sets session variables accordingly: the attribute DS.name is “${JDBCDS}”

· via the session API, I set the attribute JDBCDS to the value gotten from a system property.
· when a request is being made with ELFileBody, DS.txt gets read and every replacement gets done, on a first iteration ${DS.name} to ${JDBCDS} and then to jdbcds val

Of course I might be wrong or I misunderstood something

Then, where do you plan on using this value
I expect previous point reflects how I want to use it, I would expect, running the simulation with a system property JDBCDS with value XX to send a request like:

{“name”:“XX”,“properties”:{“userName”:“user”,“password”:“password”}}

Bear in mind that I can’t set this ${JDBCDS} EL at DS.txt, as this is a simplified example

Of course I might be wrong or I misunderstood something

You indeed get it wrong. The "feed" operation injects the raw data into the
sessions and there's only one single pass in expression resolution, no
inception.

Bear in mind that I can't set this ${JDBCDS} EL at DS.txt, as this is a

simplified example

Not feasible then with Gatling features. You'd have to develop it yourself
like you've being doing so far.

Nice, the Inception was the keyword here. Will keep on with te hand-made replacements

Have fun!