Dec 7th, 2012, 10:05 PM
Suggestions for issuing multiple Rest request concurrently from controller method
I have a Spring MVC implementation which issues Rest requests to multiple services with in the controller methods. The controllers then map the responses to the UI model and return it to the UI. I currently have it working using the Spring RestTemplate to make the requests and handle responses and such. The issue I have is that when I have a controller method that makes multiple Rest requests they are made in serial which makes the response times to the UI much larger. Can anyone point me to an example or give me some ideas of a strategy to use where I can make multiple Rest requests from within a single controller method concurrently?
Dec 8th, 2012, 04:36 AM
Not sure why this would be tied to the web stuff... Simply use springs task executor and let that execute the tasks and wait for the results. I suggest a read of the specific part of the reference guide for that.