Hi 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 ...................................... Silverbullet Skovsgårdsvænget 21 8362 Hørning Tlf. +45 2962 7576 Web: www.silverbullet.dk -----Original Message----- From: jhcha [mailto:[EMAIL PROTECTED] Sent: 2. juni 2008 07:17 To: [email protected] 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 ... result.close(); // 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. Sincerely J. H. Cha Hello! 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 ;) [1] http://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java Roman -- View this message in context: http://www.nabble.com/Bug-at-the-camel-http-component-tp17511201s22882p17594124.html Sent from the Camel - Users mailing list archive at Nabble.com.
