Solved

creating 200 instances of httpclient

Posted on 2013-06-04
2
261 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 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

726 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