hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Migrating to HttpClient 4.3.1 from 4.2.6 - Solr
Date Sun, 05 Jan 2014 16:03:51 GMT
On Sat, 2014-01-04 at 14:30 -0700, Shawn Heisey wrote:
> Recently the Lucene-Solr projectupgraded HttpClientin our codebase from
> 4.2.6 to 4.3.1.
> 
> https://issues.apache.org/jira/browse/SOLR-5590
> 
> Although this did not require any java code changes and seems to have
> occurred without any new test failures, it will come as no surprise to
> anyone here that this has resulted in lots and lots of deprecations in
> existing code.
> 
> I am attempting to fix this situation, but I am coming up pretty empty
> while looking for comprehensive information on how to migrate.  I made a
> small start after a lot of research:
> 
> https://issues.apache.org/jira/browse/SOLR-5604
> 
> It seems that there is no longer any non-deprecated way to change
> default parameters on an existing HttpClient object, and what few
> examples I can find suggest changing parameters on the request, not the
> client. 

That is intended. HttpClient instances are expected to be immutable (not
their dependencies though). This helps make them thread safe without
incurring an overhead of synchronization. One should customize
individual requests or execution contexts and never meddle with
HttpClient instances.

>  Using HttpClientBuilder is going to require a fairly
> significant paradigm shift for Solr, and I could really use a migration
> guide or some extremely comprehensive examples.
> 

There is no migration guide but HttpClient programming principles are
covered here

http://hc.apache.org/httpcomponents-client-4.3.x/tutorial/html/index.html

> Are there any more significant deprecations coming in the foreseeable
> future that we should prepare for now?  I know that nobody can reliably
> predict the future, but if I can write code that stands a chance of
> continuing to be functional through the next two major HC versions, I'd
> like to.
> 

No, no major API changes are planned for the 4.x series of releases. The
release of HttpClient 4.0 was rushed (which is a long and unpleasant
story) and many aspects of 4.0 APIs were not fully worked out. 4.3 is
essentially what 4.0 should have been.  

One can expected some APIs changes in 5.x series but 5.0 cannot be
expected any time soon, if ever.

I will happily help you with migration to 4.3 if you have any specific
questions of issues. I will also keep an eye on SOLR-5604

Cheers

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message