# Session - how to get values of feeded 2 records

**URL:** <https://community.gatling.io/t/session-how-to-get-values-of-feeded-2-records/7206>\
**Category:** Gatling (Open-Source)\
**Created:** [October 10, 2022, 5:54pm UTC](https://community.gatling.io/t/session-how-to-get-values-of-feeded-2-records/7206 "2022-10-10T17:54:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeMi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gemi/32/939_2.png) [@GeMi](https://community.gatling.io/u/GeMi)\
**Post date:** [October 10, 2022, 5:54pm UTC](https://community.gatling.io/t/session-how-to-get-values-of-feeded-2-records/7206/1 "2022-10-10T17:54:49Z")

</div>

Hi,

I wondering how to get from session object values of feeded 2 records.  
As I see there is `java.lang.Object` and I don’t have idea how to extract from it values.

I want to `System.out.println` values of this object.

Any hint is appreciated 🕶

My code:

```auto
package pl.gemiusz;

import io.gatling.javaapi.core.ScenarioBuilder;
import io.gatling.javaapi.core.Simulation;
import io.gatling.javaapi.http.HttpProtocolBuilder;

import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Stream;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;

public class Case0015UUIDfeederTwoRecordsAtTheSameTimeSimulation extends Simulation {

    HttpProtocolBuilder httpProtocol =
            http
                    .baseUrl("https://postman-echo.com");

    Iterator<Map<String, Object>> feederUUID =
            Stream.generate((Supplier<Map<String, Object>>) () -> {
                        String uuidString = UUID.randomUUID().toString();
                        return Collections.singletonMap("uuidString", uuidString);
                    }
            ).iterator();

    ScenarioBuilder scn =
            scenario("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation")
                    .feed(feederUUID, 2)
                    .exec(
                            http("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation_get")
                                    .get("/get?foo=#{uuidString(0)}&bar=#{uuidString(1)}")
                                    .check(jmesPath("args.foo").isEL("#{uuidString(0)}"))
                                    .check(jmesPath("args.bar").isEL("#{uuidString(1)}"))
                    ).exec(session -> {
                        System.out.println("GeMi_feederUUID_uuidString(0): " + session.get("uuidString"));
                        return session;
                    });

    {
        setUp(scn.injectOpen(atOnceUsers(1)).protocols(httpProtocol));
    }
}

```

---

<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:** [October 10, 2022, 9:55pm UTC](https://community.gatling.io/t/session-how-to-get-values-of-feeded-2-records/7206/2 "2022-10-10T21:55:17Z")

</div>

`uuidString` would be an array of Object.

---

<div class="post-metadata">

**Author:** ![GeMi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gemi/32/939_2.png) [@GeMi](https://community.gatling.io/u/GeMi)\
**Post date:** [October 11, 2022, 3:51pm UTC](https://community.gatling.io/t/session-how-to-get-values-of-feeded-2-records/7206/3 "2022-10-11T15:51:25Z")

</div>

Thank you for hint.  
I don’t know why I don’t make correct solution with Array yesterday - I have seen that is Array of Object 😃

Today I make it 🤣

Full code:

```auto
package pl.gemiusz;

import io.gatling.javaapi.core.ScenarioBuilder;
import io.gatling.javaapi.core.Simulation;
import io.gatling.javaapi.http.HttpProtocolBuilder;

import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Stream;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;

public class Case0015UUIDfeederTwoRecordsAtTheSameTimeSimulation extends Simulation {

    HttpProtocolBuilder httpProtocol =
            http
                    .baseUrl("https://postman-echo.com");

    Iterator<Map<String, Object>> feederUUID =
            Stream.generate((Supplier<Map<String, Object>>) () -> {
                        String uuidString = UUID.randomUUID().toString();
                        return Collections.singletonMap("uuidString", uuidString);
                    }
            ).iterator();

    ScenarioBuilder scn =
            scenario("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation")
                    .feed(feederUUID, 2)
                    .exec(
                            http("GeMi_UUIDfeederTwoRecordsAtTheSameTimeSimulation_get")
                                    .get("/get?foo=#{uuidString(0)}&bar=#{uuidString(1)}")
                                    .check(jmesPath("args.foo").isEL("#{uuidString(0)}"))
                                    .check(jmesPath("args.bar").isEL("#{uuidString(1)}"))
                    ).exec(session -> {
                        Object[] uuidStringArray = session.get("uuidString");
                        System.out.println("GeMi_feederUUID_uuidString(0): " + uuidStringArray[0]);
                        System.out.println("GeMi_feederUUID_uuidString(1): " + uuidStringArray[1]);
                        return session;
                    });

    {
        setUp(scn.injectOpen(atOnceUsers(1)).protocols(httpProtocol));
    }
}

```

Code in Repo:  
[Case0015UUIDfeederTwoRecordsAtTheSameTimeSimulation](https://github.com/gemiusz/gatling-examples-maven-java/blob/master/src/test/java/pl/gemiusz/Case0015UUIDfeederTwoRecordsAtTheSameTimeSimulation.java)
