I am writing a web application to be deployed on tomcat. I am writing a servlet. When I receive a request, I need to call 10 other different websites. Then aggregate responses received from all of them and respond. Now if i call every website in a sequence, it takes lot of time. Is there a way to complete this task in parallel?
I mean is there a way to call 10 websites in parallel? Can I use java multi-threading?
I am writing a web application to be deployed on tomcat . I am
Share
You could use threading, but it would probably be alot easier if you used e.g.,
HttpClientwith a connection pool of10.See 2.8.4 Pooling connection manager for further configuration details.