Websocket, STOMP protocol heartbeats

212 views
Skip to first unread message

Katerina Stepanova

unread,
Aug 16, 2018, 1:03:12 PM8/16/18
to Gatling User Group

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.

Katerina Stepanova

unread,
Aug 21, 2018, 7:33:25 AM8/21/18
to Gatling User Group
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.

saket kothari

unread,
Dec 13, 2018, 12:04:11 PM12/13/18
to Gatling User Group
Hi Katerina ,
Can you please help me in doing this?

Just some hints.

Thanks in advance

Katerina Stepanova

unread,
Dec 15, 2018, 12:51:38 PM12/15/18
to Gatling User Group
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)
Reply all
Reply to author
Forward
0 new messages