简体   繁体   中英

Test the behavior of a java web service for multiple concurrent requests

How do I test the behavior of a java restful web service in case of multiple concurrent requests? Is there any 3rd party tool that can be leveraged?

The service accepts POST method. It expects a couple of parameters in it's request body and produces the response in the form of JSON.

The functionality of the service is to perform database read operations using the request body parameters and populate the fetched data in the JSON.

I would recommend one of the following:

  1. SoapUI - superior tool for web service testing. Has limited load testing capabilities . However it does not scale (no clustered mode is available) and has quite poor reporting (all you get is average, min and max response times)
  2. Apache JMeter - multiprotocol load testing tool, supports web services load testing as well. Has better load capabilities and ways to define the load patterns and can represent load test results via HTML Reporting Dashboard . Check out Testing SOAP/REST Web Services Using JMeter article to learn how to conduct a web service load test using JMeter.

You can try Gatling to generate some load.

It has nice documentation and easy QuickStart .

For advanced usage it requires some knowledge of Scala, but it also features GUI tool for simple scenarios recording, so you can run some scripts by postman or whatever browser tool you use for debugging, record it and make that scenario automated.

After running scenarios it generates nice reports using Graphite, so you can see response times and general stats.

Later you can also use Gatling for load and performance tests of your web service, it's convenient and fast as soon as you start playing with it. It can easily generate up to 5k requests per second from my old Mac, or hold up to 1k connections.

One of the bests tools to test web services is SOAPUI.

You can use it for what you want.

Link to SOAPUI

You can check this link to see how to use SOAPUI and concurrent tests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM