简体   繁体   中英

RestEasy: Handling concurrent requests

I need to know the details how rest easy with jBoss handles multiple concurrent request for a webservice. For example I have made a webservice, which downloads a particular file. I need to check how the system will behave if say 100 or more people hit the service at the same time.

Is Resteasy framework handling own its own in multithreading or that needs to handled at our end. Or will the server handle it?

RestEasy is an implementation of the JAX-RS specification. According to JAX-RS for every new HTTP Request a new Rest Resource class is by default constructed (exceptions are eg when you are inside other frameworks like Spring, which is very unlikely). Given that said, you are guaranteed that your code (actually state) in Rest Resources is thread-safe. But if you have some other code deeper, like something stored in your HTTP session, or some services that are used in your Rest Resources (directly or indirectly), then it is your task to make it thread-safe.

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