Nov 17th, 2012, 09:57 AM
Spring MVC 3.2 : Async support with Callable and 3rd party REST API call
I have Spring REST Controller GET method (which has a dependency on a Service) which has to do a call to another 3rd party REST API (which takes a little time) in order to send a JSON response. I would like to know the best way to optimize all of that.
So, i had a look at Rossen Stoyanchev presentation http://rstoyanchev.github.com/spring-mvc-32-update in order to see the new async support.
In the presentation, it is said that using the new async support with Callable for a 3rd party REST API call is appropriate.
I don't understand why using this new functionnality would be more scalable in my case, because even if the thread of the container is released before sending the response, another thread via the asyncTaskExecutor has to do the 3rd party call and wait for its response in order to build the JSON response. So i think the problem is not on the container thread pool anymore but on the asyncTaskExecutor thread pool. Am i right ?
So, could you precise your thought when you say that using async support with Callable is suitable for "3rd party REST API call" ?
Thank you very much.
Last edited by davidovitch; Nov 17th, 2012 at 10:09 AM.
Tags for this Thread