I have a test case for testing WebSocket over STOMP latency.
I couldn’t find a good example of STOMP over WS implementation in the documentation. I found a “STOMP protocol client library for k6” on GitHub. But my test case is way complicated than the example provided, I wasn’t sure if I can use it. Anyone has done STOMP over WS testing via k6?
For those who are not familiar with STOMP, it is a protocol that sits on top of WS. It sets out a framework for how communication should happen.
https://stomp.github.io/stomp-specification-1.2.html#CONNECT_or_STOMP_Frame
A little bit of detail about my test case. Here is the sequence of operations that I need to simulate via K6. And I also need to construct different STOMP frames. An example for using CONNECT frame in step 1 to connect to the WS.
-
A Producer connects to WS over STOMP via STOMP connect frame.
String connect = “CONNECT\n” +
“accept-version:1.1,1.2\n” +
“heart-beat:0,0\n” +
“sfEndpoint:${sfendpoint}\n” +
“sfSession:${sfsession}\n” +
“\n” +
‘\0’ ; -
The producer creates a session id via STOMP subscribe frame.
-
A Subscriber connects to the WS over STOMP
-
The subscriber subscribes the session via session id that was created by producer
-
Once the subscriber joins the session, the producer starts sending commands via STOMP send frame.
-
Verify if the subscriber receives the commands and check the latency.