Websocket, STOMP protocol heartbeats

Hello!
App I’m testing is using STOMP protocol over websocket.

What I need is sending a specific string on websocket every 20 seconds
AND
Sending other requests and waiting for responses at the same time.

Is there any way to send websocket message once in a while without blocking any other websocket checks and actions?

I’ve thought about sending this heartbeat messages just before/after every normal websocket request, but waiting time might be greater than max time allowed between heartbeat messages, and I’m loosing connection.

Any ideas what I could do? Maybe it’s possible to implement my own type of websocket checks? Unfortunately I’m no expert in Scala and I’ve got no idea where to start with it.

Solved it.
I’ve created my own custom variant of WsActionBuilders, WsActor etc. The only thing added so far is sending heartbeat on every server heartbeat arrived in OnTextMessage, which solves the issue completely in my case.

Hi Katerina ,
Can you please help me in doing this?

Just some hints.

Thanks in advance

Are you using Gatling 3?

I’ve done it in 2.3.1 only so far (yes, it takes care of general websocket ping-pongs, but heartbeats i’m dealing with are different).
I’ve found a place in Gatling code, dealing with received message - WsActor.scala, created my own version of that class, and of everything that was using it (mostly just copy-paste with a few additions of my own, like failing a test step when some message on error channel is received, plus some additional logging).
WS, WSActionBuilders, WSActor, WSOpen, WSOpenRequestBuilder - those are the files that i had to create my own versions of.

Feel free to ping me around 25-26 Dec, I will have some time to investigate possibility of migration to Gatling 3 in my project then, and i might have more ideas on how to handle heartbeats there)