I've got a JMeter test where I'm currently using a loop to find out if some condition is true. Rather than polling, I would like to (and can) use a request on a resource that sends out server-sent-events (SSE). The way it should work, is that the SSE thread is started and than another thread is started which does a request that ultimately will cause a specific event to be sent. If that event is received processing should continue.
Maybe more clear graphically. My current script looks something like this:
ThreadGroup
|
+ request 1
+ request 2
...
+ request N
+ Transaction controller
| |
| + While controller
| + polling request
|
+ request N+1
I would like something like this
ThreadGroup
|
+ request 1
+ request 2
...
+ <help needed here>
| |
| + event thread
| | + request SSE
| | + onEvent x: y = true
| + action thread
| + request N
| + While y=false wait
+ request N+1
Is this possible? If so how? If not, can I create a sampler to do this? Any pointers?
Groeten,
Friso
I think you will have to implement your own class.
First, as a client of SSE, you should look at this:
The second step is to implement a custom sampler that will extend this class:
And use it with this GUI:
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 :-) ):
These are just initial ideas and need more work.