Solved

creating 200 instances of httpclient

Posted on 2013-06-04
2
254 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
2 Comments
 
LVL 26

Accepted Solution

by:
mrcoffee365 earned 250 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 250 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now