camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: Bug at the camel-http component
Date Mon, 02 Jun 2008 05:27:14 GMT

I do think this should be added to the wiki documentation of the http component that the end
user should handle the closing of the ressource so connection pooling works.

Sorry if its already added as documentation

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: jhcha [] 
Sent: 2. juni 2008 07:17
Subject: Re: Bug at the camel-http component

Dear RomKal

I checked your advice.
I found the connection released when I closed the InputStream object
returned by requestBody() method.
like this : 

InputStream result;
result = (InputStream) template.requestBody("direct:start", body);
// do someting with result ...
// ok

Camel has not any bug in http component I thought it has "releasing http
connection bug"

That is the way 1) the http connection is release correctly to http client
manager connection pool. 
Maybe I did a little bit not understand that way clearly. 

Your advice was very nice for me. 

Thanks a lot.


J. H. Cha


Thanks for looking into this, but I believe we are OK, and in fact
your problem is described at [1]. We should clearly put it to
camel-http wiki page.

The problem is that if we release the connection just after we execute
the method we no longer can read from the stream returned by http
method execution.

There are two different solutions to this problem. 1) read the stream
just after receiving it inside endpoint itself or 2) accept the fact
that we don't know when to close the stream and put this
responsibility to the user.

advantage of 1) is that we always release the connection (it is
released when we close the stream or read it completely), but 2) could
be better, because we don't have to put the response into some object
that might be not needed at all (and it is backward compatible because
it returns stream).

I just took the second approach when I was working on it as in
majority of cases we read our responses anyway ;)



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message