Hello,
I am having some problems building scenarios for binary websocket transmission. The first is that I cannot receive data back from the server after sending a binary message (which works correctly). Is there some sort of “raw” check I can do to receive and decode what the server is sending back?
`
exec(ws("Fetch random obj WS")
.sendBytes(MsgPack.pack(Map(
"stream"->"objects",
"payload"->Map(
"action"->"random_object",
"method"->"GET"
)
)))
.check(wsAwait.within(30).until(1).saveAs("random_object"))
)
`
This check does not work, and regex/json won’t work on a binary msgpack stream coming from the server.
The second problem I am having is putting a session value into a websocket send_bytes. It appears that the exec() will have to return either the ws().sendBytes() or the session, but cannot return both. Is there some way around this, to feed the session value into the sendBytes function?
`
.feed(number_feeder)
.exec (
{ session =>
ws("Submit random WS")
.sendBytes(MsgPack.pack(
Map(
"stream" -> "objects",
"payload" -> Map(
"method" -> "POST",
"data" -> Map(
"random_choice" -> session("random_number").as[Int]
)
)
)
))
session
}
)
`
Returning the session makes gatling not send the bytes. Not returning the session and returning the ws().sendBytes() returns the following error:
`
[ERROR] i.g.c.ZincCompiler$ - … type mismatch;
found : io.gatling.http.action.async.ws.WsSendBuilder
required: io.gatling.commons.validation.Validation[io.gatling.core.session.Session]
`
Best,
Peter