Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

creating 200 instances of httpclient

Posted on 2013-06-04
2
Medium Priority
?
269 Views
Last Modified: 2013-06-27
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
Comment
Question by:hamid441
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 1000 total points
ID: 39219953
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
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 1000 total points
ID: 39224819
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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question