I'm new to Java world, So I need small help from Java geeks over here
I want to send multiple concurrent requests (say 100) to a Java web service and want to log the response back asynchronously.
I have tried searching on internet, But I was not able to find any proper answer(Maybe due to my little knowledge).
Any lead would be helpful.
You can make use of shell scripting to make a curl request 100 times and log back the response in a text file which might be some .text or .log file
posted 2 years ago
@ Sibendu, Thank you so much for your help. it is really helpful.
I will try with curl.
Here, I would like to ask is there any way using Java code to achieve this?
As I was searching, I found that there is concurrent package in Java which can provide this functionality.
But I'm still searching how to achieve that.
In java , every http request is routed through a servlet dispatcher which in turn invokes a servlet.Each http request is handled as a separate operation in its own call stack ( by a thread).So multiple threads will be created by the container to take care of multiple requests.Having said so you do need to take care about your classes and their members being accessed concurrently by several threads with the help of synchronization mechanism.