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
So what you need to do is, in your Test Plan, add 5 Thread Groups. In each Thread Group configure the number of Threads to 5 and Ramp Up to 0. Now, add one HTTP Request sampler in each Thread Group. Configure each sampler according to the URL you want to test.
You should add multiple "Thread Group" into a "Test Plan". Inside "Test Plan" Unselect "Run thread groups consecutively". Inside every "Thread Group" configure "Number of Threads(users)" as "1", "Ramp-Up Period" as "0", "Loop Count" as "1". Now, add "HTTP Request" into each "Thread Group".
What is SSE in Testing? SSE is the technology for transferring data from a server to clients. Clients can be desktops or mobile devices with running applications and services, or web applications open in clients browsers.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With