Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

creating 200 instances of httpclient

Hi all,
My java application needs to read data from ~200 end-points hosted on different servers . Should I have an instance of httpClient for each end-point or use a application wide client.  Although the user guide suggests having one http client per application, I would like to have a  separate client for each URL to be able to fine tune for optimization. So here is my question: is is practical to create many (around 200) http clients? the creation will be done during startup so I am not worried about performance cost associated to instantiating the clients.
0
hamid441
Asked:
hamid441
2 Solutions
 
mrcoffee365Commented:
I don't think it would be a problem -- it depends on what you're doing, of course.

It's also very easy to try -- why don't you do that if you have specific concerns?
0
 
ValeriCommented:
In my opinion it will slow down the application. creating such huge number of HttpClients will create a lot ot respective pools intended to support connection managment. So switching between such huge number ot threads will slow down the JVM, because most of the time will be consumed by swithing between thread contexts.
Anyway, as "mrcoffee365" said, just try, it's easy!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now