I am trying to create my gRPC payload by reading data from a csv file(it has guestID and category as columns). I followed the example here https://github.com/phiSgr/gatling-grpc/blob/244ab372da6773102d79c65a7e4086f409d3fe94/src/test/scala/com/github/phisgr/example/GrpcExample.scala but I see a type mismatch error when I try the same. (it expects Seq[ContextKey] but here i am able to form Seq[Expression[ContextKey]])
val scn2: ScenarioBuilder = scenario("gRPC call - 50 users repeated 100 times")
.feed(csv("testtext.csv"))
.exec(
grpc("gRPC request with test message")
.rpc(RecommenderGrpc.METHOD_GET_RECOMMENDATIONS)
.payload(RequestContext.of(Map("test" -> "test"),
Seq(ContextKey.defaultInstance.updateExpr(
_.id :~ $("guestID"),
_.`type` :~ Type.GUEST
), ContextKey.defaultInstance.updateExpr(
_.id :~ $("category"),
_.`type` :~ Type.CATEGORY
)),
Seq())
)
)
(payload is a RequestContext object which takes in metadata, keys and items. metadata is a map, keys is a Seq of ContextKey and items is empty Seq. ContextKey contains string guestID or category and type).
How to use the variables in the feeder here?