You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/04/16 16:10:17 UTC

[jira] [Issue Comment Edited] (CAMEL-4098) camel-http - Apparently it forces the streamcache

    [ https://issues.apache.org/jira/browse/CAMEL-4098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254706#comment-13254706 ] 

Willem Jiang edited comment on CAMEL-4098 at 4/16/12 2:08 PM:
--------------------------------------------------------------

HttpClient will close the InputStream automatically, when the connection is closed.
So we need to cache the InputStream in the HttpProducer before close the connection.

We can not leverage the on completion method of Exchange as the input stream maybe used after the exchange is completed. The [JettyHttpFileCacheTest|https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/issues/JettyHttpFileCacheTest.java] in the itest module shows the case that temp file will be deleted when the exchange is on completion before sending the response from the proxy.

We should let the user know that he has the responsibility to close the stream to release the temp file.
                
      was (Author: njiang):
    HttpClient will close the InputStream automatically, when the connection is closed.
So we need to cache the InputStream in the HttpProducer before close the connection.

We can not leverage the on completion method of Exchange as the input stream maybe used after the exchange is completed. The [JettyHttpFileCacheTest|https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/issues/JettyHttpFileCacheTest.java] in the itest module shows the case that temp file will be deleted when the exchange is on completion before sending the response from the proxy.

                  
> camel-http - Apparently it forces the streamcache
> -------------------------------------------------
>
>                 Key: CAMEL-4098
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4098
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.10.0
>
>
> It seems there is logic in camel-http that stream cache, regardless what.
> We should avoid this as ppl should be able to use Camel with the streams directly.
> And there seems to be an issue that the camel-http doesn't clear tmp files. Seems like the on completion isnt added to the Exchange which ensures to delete the tmp files.
> See nabble
> http://camel.465427.n5.nabble.com/http-not-cleaning-up-tmp-files-when-exchange-is-stopped-tp4269124p4269124.html
> This is most likely also an issue with camel-http4

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira