Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST WebService and concurrency in java

I'm going to write a simple REST webservice for downloading files from server( a simple GET method) The question is: Do I have to handle concurrency in this situation or the web server is going to do that?

like image 664
Super Hornet Avatar asked Dec 03 '25 17:12

Super Hornet


1 Answers

It depends on what you mean by "handle concurrency". Do you have to write code to spawn threads on each incoming request? No, Jersey will create a new thread for each request before it calls your API method. Do you need to worry about a DELETE request coming in when somebody else is GETing a file? Yup.

like image 56
Eric Stein Avatar answered Dec 05 '25 06:12

Eric Stein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!