# Feeder value #{WEB\_ID} not recognized in ChainBuilder (Java) simulation

**URL:** <https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435>\
**Category:** Gatling (Open-Source)\
**Created:** [November 10, 2023, 2:35pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435 "2023-11-10T14:35:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdbanks](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sdbanks/32/1356_2.png) [@sdbanks](https://community.gatling.io/u/sdbanks)\
**Post date:** [November 10, 2023, 2:35pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435/1 "2023-11-10T14:35:25Z")

</div>

I have created my first simulation. I used Java as that is my working language.

In my simulation, I have a feeder defined as

```java
FeederBuilder.Batchable<String> **web_ids** = csv(Config.USER_CSV).random();

```

It does exist as I tried to change the value and it causes a stacktrace.

I am passing the feeder to the scenario using the following

```java
	ScenarioBuilder scn = Save490.getScenario()
	    .feed( **web_ids** );

```

In the `Save490` class, the code in question being executed is.

```java
	    ChainBuilder scn = exec(
		  http("request_0")
// .get("/bhsol-pssd/prot/system-messages?webid=WEB.109430") /// **WORKS**
            .get("/bhsol-pssd/prot/system-messages?webid=#{WEB_ID}") /// **/// FAILS**.....

```

If I use the commented out line, it works, but when I use the `?webid=#{WEB_ID}` it fails with

```console
10:19:34.021 [ERROR] i.g.h.a.HttpRequestAction - 'request_0' failed to execute: No attribute named 'WEB_ID' is defined.

```

In my CSV file, I have the following.

```plaintext
WEB_ID,UNIQUE_ID
WEB.109430,531E0DA0-AC01-4736-A945-03F60F03200E
WEB.109430,531E0DA0-AC01-4736-A945-03F60F03200E
WEB.109430,531E0DA0-AC01-4736-A945-03F60F03200E

```

Is there something I am missing in how the feeder is supposed to work?

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [November 10, 2023, 2:43pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435/2 "2023-11-10T14:43:08Z")

</div>

Not sure as you don’t provide the full code but I suspect you’re attaching `feed` to your scenario flow AFTER your requests.

In short, I suspect your doing:

```java
exec(
http(“request_0”)
 .get(“/bhsol-pssd/prot/system-messages?webid=#{WEB_ID}”)
).feed(web_ids)

```

while your should be doing

```java
feed(web_ids)
.exec(
http(“request_0”)
 .get(“/bhsol-pssd/prot/system-messages?webid=#{WEB_ID}”)
)

```

---

<div class="post-metadata">

**Author:** ![sdbanks](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sdbanks/32/1356_2.png) [@sdbanks](https://community.gatling.io/u/sdbanks)\
**Post date:** [November 10, 2023, 3:30pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435/3 "2023-11-10T15:30:57Z")

</div>

That fixed it.

In my Save490 class, I created two chains, the first one being only the Feeder that you asked me to pass into the method which is now

```java
	 public static ScenarioBuilder getScenario(**FeederBuilder.Batchable<String> web_ids)** {
              ChainBuilder chain_web_ids = exec().feed(web_ids);		 
  	      ChainBuilder chain_490_Save = exec(
               ...
               );
              return scenario("Process Inbox").exec(chain_web_ids).exec(chain_490_Save);
        }

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [November 10, 2023, 3:32pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435/4 "2023-11-10T15:32:35Z")

</div>

ChainBuilder chain\_web\_ids = feed(web\_ids);

is enough, no need for this empty exec.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [December 10, 2023, 3:33pm UTC](https://community.gatling.io/t/feeder-value-web-id-not-recognized-in-chainbuilder-java-simulation/8435/5 "2023-12-10T15:33:28Z")

</div>

Closed on December 10, 2023, 3:33pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
