JMeter parallel requests with server-sent-events

After thinking to create new sse plugin for jmeter, I found gatling.io, it supports SSE gatling.io


I think you will have to implement your own class.

First, as a client of SSE, you should look at this:

  • https://jersey.java.net/documentation/latest/sse.html#d0e11970

The second step is to implement a custom sampler that will extend this class:

  • https://jmeter.apache.org/api/org/apache/jmeter/protocol/java/sampler/AbstractJavaSamplerClient.html

And use it with this GUI:

  • http://jmeter.apache.org/usermanual/component_reference.html#Java_Request

Now for the most complex part (maybe we should create a github project to discuss this implementation and once finished contribute it to core JMeter project :-) ):

  • The SSESampler sampler can work in 2 modes :
    • Block until it receives the response from server, this way you can assert on result
    • Start a thread (better use a pool of threads or Reactor pattern) to listen from server, once it gets the response, we have to find a way for the initial thread to be able to access this and assert. We could work with a thread safe Map shared and where data would be keyed by some data passed to the SSESampler

These are just initial ideas and need more work.