parsing STOMP messages

Hello Everyone,

My test scenario includes receiving STOMP messages with “application/json” content-type from a websocket server. In some cases I need to parse the content of such messages in order to use some particular values in a subsequent “ws().sendText()” call.

My idea is to save such message to user’s virtual session, then to convert the stomp message to JSON string, and finally use Jackson and “JsonPath” to extract the value in question as shown here:

https://github.com/gatling/jsonpath

On the other hand I thought there might be some other more elegant way of doing such conversion.

Any help or ideas greatly appreciated.

Thanks,
Chris

I’m just saving messages to a session, then cleaning up all the stomp frame escape characters etc. stuff. And then deal with resulting json using Play Json library.

But I’m currently working on slightly modified ActionBuilders for STOMP over websocket, though i’m in an early beginning of this). Had to do it in order to send STOMP heartbeats and properly track errors along with normal checks. But i think it’s possible to do it so that scenario itself will already deal with proper json, and not the raw stomp frames.

Hi Katerina,

Thank you for your reply. I ended up doing the same – removing frames, unescaping, and then manipulating the underlying json. Similarly, before sending a stomp to server, I need to properly calculate the “content-length” based on the variable param values.

I’m fairly new with Gatling/Scala and ActionBuilders though.

Thanks