I'm required to send ~100 requests HTTP requests and do some processing with the results of all HTTP requests I have sent. I want to send my HTTP requests parallelly and wait until all the results are back in order to do my process. I am quite new to Java and I'm having difficulty with the approach to this. Kindly suggest a good approach or pattern.
Asked
Active
Viewed 129 times
1
-
Welcome to Stackoverflow, please read [How To Ask](https://stackoverflow.com/help/how-to-ask). Pay special attention to [How To Create MCVE](https://stackoverflow.com/help/mcve). Make sure you tag your question with proper labels (programming language, relevant technologies etc). The more effort you'll put into posting a good question: one which is easy to read, understand and which is [on topic](https://stackoverflow.com/help/on-topic) - the chances are higher that it will attract the relevant people and you'll get help even faster. Good luck! – Nir Alfasi May 30 '21 at 09:10
-
1Http is synchronous. Only thing you can do is the processing of those 100 tasks (request) processesing (individual sending + receiving + processing) async using Future Task and executor framework on threads. Here is a example https://www.baeldung.com/java-future – Sachin May 30 '21 at 09:19
-
1[Async Rest Template](https://stackoverflow.com/questions/44425641/make-api-multiple-times-with-asyncresttemplate-and-wait-for-all-to-complete) This link maybe help for you – Nurullah Eray Çalışkan May 30 '21 at 09:33