Problem with reading requests from server

Issue #151 closed
Former user created an issue

Hi Peter, I have a problem reading requests from the server (remote machine). My test case looks like this. I should open a WS connection with the server and then wait for requests coming from the server. In the event that the right request comes to me, I should send a reply (response) and wait for the next one. Is it possible to listen to and respond to incoming requests from the server using jMeter and your plugin? I will be grateful for your response

Comments (8)

  1. Peter Doornbosch repo owner

    Hi,

    I guess your question is how to wait for the “right request”. That could be done with a filter. For example, if you are processing text messages, use a WebSocket Text Frame Filter. This filter enables you to match frames that contain (or do not contain) specific content and discard these frames. If you are able to filter out all messages that are not the “right request”, only the “right request” would pass the filter and than you can catch it with a “Single Read Sampler” and answer with a “Single Write Sampler”.

    Hope this helps,
    Regards
    Peter

  2. Janusz Smogorzewski

    Hi Peter,

    thank you for your response. I’m still not sure if I can archive what I need, so please let me clarify my case.

    First, JMeter sends an http request to receive a session id from the server. Then based on this id creates a connection via WS (WebSocket Open Connection) and sends an initiation message. For this message, the server generates a response (confirmation of reciept of the request). And it all works good. The part that I’m not sure begins when JMeter should now listen on this connection for incoming requests from the server and send a response to each ot these requests. On one JMeter initialization request, the server can send multiple requests to JMeter. Is JMeter able to handle these requests by sending a response to the server each time?

    Below is next attempt to read incoming requests from the server:

    Regards

    Janusz

  3. Peter Doornbosch repo owner

    Hi,

    JMeter should now listen on this connection for incoming requests from the server and send a response to each of these requests.

    What about

    Loop {
    Single read (wait for request from server)
    Single write (respond to request)
    }

    ?

  4. Janusz Smogorzewski

    Hi,

    that was my first thought. But after I was able to receive the first response from the server, I was unable to accept further requests. Hence my suspicion that JMeter for some reason didn’t want to listen on the connection and doesn’t accept further requests from the server. Hovewer, I understand that JMeter should support this scenario. If so, it remains for me to check what happens with the other packages that apparently don’t reach JMeter.

    Thank you very much for your help.

  5. Peter Doornbosch repo owner

    It definitely should work. You could enable debug logging to find out what’s going on,… --- if anything is going on. It could that the server, for some reason (invalid response?) does not send any more requests. The easiest way to find out is to use WireShark to capture the traffic and analyse that.

  6. Janusz Smogorzewski

    Hi, you can close this issue. I found bug on the server (I overloaded one of the server components and therefore messages did not come). Now, everything work correctly. Thanks for your help.

  7. Log in to comment