Multiple web-sockets in the same thread group
Hi,
I am using JMeter to test our websockets server application and now I am facing the following issue. Our application manages multiple websocket servers that interact at the same time so I would need to be able to open and keep open multiple WS at the same time to be able to use them in parallel.
I know that this plugin only allows one WS at the time and as soon as a new one is created the previous one is shut down but I wonder if you can consider the possibility to add to the plug in the possibility of use multiple WSs in the same thread.
Thanks,
Gabriele Centinaro
Comments (40)
-
repo owner -
Hi Peter. This branch is exactly what I need. I checked out the branch, compiled it and use it with JMeter 5.2.1. Can you merge this branch, so I am able to get the library from Maven Central?
Alvast bedankt! Sven
-
reporter Hi Peter, I did try building the repo but when I copy the jar into the lib/ex folder and try to use the plugin I don’t get the “WebSocket Advanced Options” in the Non-test Elements menu.
Can you please post a build from your side that works so I can try?
Thanks,
Gabriele
-
Just check out the repo, switch to the ‘multiple-connections’ branch and type ‘grade assemble’. You will find the jar (actually 3) in the ‘build’ directory.
-
reporter I was checking out the wrong repo. It works as expected.
When can this be merged to master?
2020-05-04
-
reporter Hi Peter,
Do you have any plans to merge into master the multiple-connections branch so it becomes part of the official plug-in?
Thanks,
Gabriele Centinaro
-
repo owner Hi Gabriele,
I had not until now, but with the feedback of you two, i think it’s time to merge it. Will try to do this soonish, but i’m quite busy at the moment, so i can’t promise when it will be done.
Thanks for your feedback.
Cheers,
Peter -
reporter Thanks Peter I understand and I appreciate all your help.
Gabriele
-
repo owner 👍
-
I downloaded the repository and build it but could not find “WebSocket Advanced Options” in the Non-test Elements menu. Can you please elaborate on how to add this in jmeter?
-
Did you download the right branch? And did you add it to the right lib/ext directory of JMeter? You should just see the option if you are on the top-level of your project.
-
Yeah. I downloaded the multiple connections branch. Then I added it in lib/ext of my apache jmeter folder. One thnng that bothers me is I downloaded the zip but every other folder in lib/ext are jar folders
-
You should extract the zip, build the project (with gradle assemble) and then in the build directory move the jar to the lib/ext directory
-
repo owner Thanks Sven.
-
Thank you @Sven Koster . I got the Websocket Advanced Options in non-test elements but I do not get any connection-id field or any additional feature as described by @Peter Doornbosch . Do I need to do something more to make it work?
-
Did you add the Advanced Options and turned it on? You should. Then you get an extra option called ‘Connection ID’. I normally put in a number to differentiate.
-
Yeah I chose the Advanced Options. but connection-id field does not appear.
-
repo owner Which version of JMeter are you using?
-
5.2.1
-
repo owner I cannot reproduce this. I downloaded JMeter 5.2.1, created a test plan, added a “WebSocket Single Read Sampler”, added “WebSocket Advanced Options”, checked “Enable multiple connections per thread”. Then, when i select the read-sampler, there is a “Connection ID” field just below the “setup new connection” radio….
-
Me neither. I tried 5.2.1 and the new 5.3. Both just work as described.
-
reporter All correct here as well.
A similar problem happened to me the first time I tried, i was downloading the wrong branch.
-
I am having issues in building the project after downloading the repository. Can you please help me on this by providing detailed steps.
Below are the steps which I followed, let me know if any of the steps followed are wrong
- Downloaded the repository to local machine and extracted the zip folder. Refer below screenshot for the repository which i downloaded
2. Installed Gradle in local machine
3. In cmd prompt, Navigated to the local repository path and executed the command 'gradle assemble'.
Build is failing with below error
-
Hi Peter, any ETA when you will merge this branch to master?
-
@Kartik Kanda : it looks like you don’t have an internet connection. You have to see how to configure gradle to be able to download sources from the internet. It has nothing to do with this code.
-
Hi ,
I am able to build project and see Websocket Advanced options in Jmeter, after adding the jar to lib/ext
But when I goto Jmeter ->Test Plan-> Non Test elements-> Select ‘WebSockets Advanced Options’, I am getting below error. Can you let me know the reason for this error and solution to it
2020-06-09 09:56:41,104 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
java.lang.NoSuchMethodError: eu.luminis.jmeter.wssampler.WebsocketSampler.checkJMeterVersion()Z
at eu.luminis.jmeter.wssampler.AdvancedOptionsElement.<clinit>(AdvancedOptionsElement.java:30) ~[JMeterWebSocketSamplers-dev.jar:?]
at eu.luminis.jmeter.wssampler.AdvancedOptionsGUI.createTestElement(AdvancedOptionsGUI.java:82) ~[JMeterWebSocketSamplers-dev.jar:?]
at org.apache.jmeter.gui.GuiPackage.createTestElement(GuiPackage.java:373) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.AddToTree.doAction(AddToTree.java:67) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.3]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[?:1.8.0_202]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) ~[?:1.8.0_202]
at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:1.8.0_202]
at java.awt.EventQueue$3.run(EventQueue.java:709) ~[?:1.8.0_202]
at java.awt.EventQueue$3.run(EventQueue.java:703) ~[?:1.8.0_202]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_202]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[?:1.8.0_202]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) ~[?:1.8.0_202]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) [?:1.8.0_202]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_202]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_202]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_202]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_202]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_202]
-
repo owner Do you have two versions of the plugin in your jmeter lib/ext directory?
-
Yep. I have removed one now and kept only one plugin which I built. It is working and I am able open Websockets Advanced options. Thanks
-
repo owner 👍
-
repo owner @Sven Koster “any ETA when you will merge this branch to master?”
No, sorry, not yet. I developed this feature long time ago and i remember that there was left some work to do, so it’s not just a matter of merging; i want to bring it to production quality before merging to master.
What would merging to master bring you that you yet don’t have?
Regards
Peter -
reporter Hi Peter,
The multiple web-sockets branch is from 2018‑11‑19 and since then you fixed a lot of things that are int he master branch. I thought about using directly the branch but I am afraid of what consequences could have on my current scripts.
Gabriele
-
@Peter Doornbosch : I can’t use this jar; I use it from an project where I use JMeter from junit through java. I start JMeter programmatically. To use this code I need a maven dependency, as the project is built by maven. So I can only include what is in maven central and not separate branch builds.
-
reporter @Peter Doornbosch,
Hi Peter, any news about merging this feature?
Thanks,
Gabriele
-
repo owner Hi Gabriele,
I merged master branch into multiple-connections branch for you. So at this point, all fixes and improvements that are introduced on master, are now also in this branch. So you don’t have to fear that using this branch would break your current scripts.
Hth,
Peter -
Hi @Peter Doornbosch , can the
connection id
contain also@groovy()
scripts to generate the id? Because I need multiple connections per thread and if the connection id is per thread group and not per thread it will interfere. Like if 2 threads make connection id “1”, they both read the same WebSocket when referencing “1”, or do they have their own private reference? -
reporter Thanks Peter,
The branch seems to work perfectly and I can manage now multiple WS in the same thread.
One question, moving forward will you maintain both master and this branch?
If you make a fix in master because of a bug or new feature, will that also be merged in this branch?I am always worried using a branch instead of master I will be forced not to take advantage of any future implementations.
Gabriele
-
Hi Peter Doornbosch,
I hope your doing well. Recently, we had opportunity to use your multiple WebSocket connection feature into our ongoing project.
We've found it immensely beneficial, since we have condition to run multiple WebSocket calls from a single ThreadGroup.No issues we're encountered during our extensive use of multiple WebSocket calls and we firmly believe that incorporating this
functionality into the master build and including it in the current WebSocket plugins would be advantageous.Doing so would not only streamline the process of current user but also facilitate its accessibility for future users
who can utilize it without the need for separate jar file builds.I hope you find a time making this feature official.
Super Thanks!
Rhia -
repo owner Hi Rhia,
Thanks a lot for your feedback! Great to hear that this feature was useful and that you didn’t encounter any issues with it. Makes me certainly more confident about merging it onto master.
Thanks
Peter -
I have used multi-connection web-socket and its working great but I have an issue that if I’m using WSS connection for longer duration I get these errors :
Response code:Websocket I/O error
Response message:WebSocket I/O error: Connection reset by peerhow can I extend life of WSS connection?
-
Hello, I have a problem. When I use the official version of the same WebSocket interface, my requests are processed normally. However, when I use multiple WebSockets, I receive a 404 error. The server log indicates that the request origin is not allowed, but the data in the request header is the same.They are the same interface
- Log in to comment
Hi,
There is a proof-of-concept of this feature in the https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/multiple-connections/ branch. See the readme (link <-) in this branch for details. If you are going to try it, i’d like to get some feedback.
Hth
Peter