Announcement Announcement Module
No announcement yet.
Spring MVC 3.2 : Async support with Callable and 3rd party REST API call Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 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, 10:09 AM.