hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35728] - getResponseBody always logs messages
Date Fri, 15 Jul 2005 21:31:02 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35728>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35728





------- Additional Comments From incoming@jillesvangurp.com  2005-07-15 23:31 -------
I don't think we'll end up agreeing. I fundamentally believe httpclient is
misbehaving here and shouldn't. Otherwise it is great stuff and much appreciated
BTW.

I somehow always end up having to do stuff in memory, which requires doing a
getResponseBody(). I can't optimize this need away, I need to buffer. I do non
trivial stuff which is hard to do in a streaming fashion (and I agree, if you
can do it streaming: do so). I'm not alone, that's why these methods are in the
API. If you accept that simple fact you'll see it is bad practice to keep
printing stuff in the log whenever people choose to use the non deprecated api.

The only good solution is not logging. The log is not an educational tool. If it
is an error throw exceptions otherwise shut up. Simple principle that shouldn't
be violated by any 3rd party software IMHO. Httpclient log warnings are always a
problem in any production software. Don't require addiotional code,
configuration, whatever for normal behavior. The negative effects of buffering
are properly documented in the javadoc and tutorials, that should be enough.

But I'll shut up now, we apparently disagree and it's not an important issue to
me. Please don't post another workaround here I knew about all of them (and have
practiced them) except for the BUFFER_WARN_TRIGGER_LIMIT which should probably
in the javadoc of these methods. I'll probably end up setting it to a very large
number in all my software. Again my point is that I shouldn't have to, not that
I don't know how to fix it.

(In reply to comment #7)
> Jilles,
> I second Odi's opinion. Besides, the use of HttpMethod#getResponseBody and
> HttpMethod#getResponseBodyAsString is strongly discouraged. It is advised to use
> HttpMethod#getResponseBodyAsStream instead. See HttpClient optimization guide
> for details:
> 
>
<http://jakarta.apache.org/commons/httpclient/performance.html#Request/Response%20entity%20streaming>
> 
> Oleg



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message