WebSocket latency testing using STOMP protocol

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.

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.

  1. 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’ ;

  2. The producer creates a session id via STOMP subscribe frame.

  3. A Subscriber connects to the WS over STOMP

  4. The subscriber subscribes the session via session id that was created by producer

  5. Once the subscriber joins the session, the producer starts sending commands via STOMP send frame.

  6. Verify if the subscriber receives the commands and check the latency.

Hi @alex

I’m sorry I’m not too familiar with Stomp, and can’t provide any guidance myself on this.

However, I wanted to make sure to point you out to our newer websockets implementation, maybe it could prove useful?
Also, from reading your post, I didn’t fully understand what your problem, or rather your exact goal was. Thus, I believe it could be worth rephrasing and proving more details as to what you wish to achieve :handshake:

Hi @oleiade
My goal is to create a WebSocket latency test case with k6. The 6 steps that I described in my post were the test case detail that I wanted to create. However I had issue to setup the connection because k6 WebSockets implementation does not support STOMP protocol out of box. I had to use JMeter at this time because JMeter has WebSocket plugin that supports STOMP protocol that I can use directly. That’s why I posted this question to see if anyone had similar websocket testing requirement using STOMP with k6, how did they create the test case… I am looking for some guidance.