Hi Jason,
I just went though the HttpProducer code, and found if you don't close
the input stream from the message body, the temp file will never be
cleaned unless the camel application exits.
The CachedOutputSteam will not be closed when the exchange of the
HttpProducer oncomplicated, that is because the input stream will be
used after the exchange is oncomplicated.
Can you double check your code for it?
Willem
On 6/11/11 3:43 AM, Jason Burkhardt wrote:
I dug into this a little further, here's the underlying behavior of the
HttpProducer:
The method doExtractResponseBodyAsStream in HttpProducer ends up creating a
CachedOutputStream based on the server response. This ends up creating a
cos* temp file in java.io.tmpdir+/camel-tmp.
These files are only cleaned up when the application is stopped.
As a result if I leave everything running for several days this directory
grows very large as I request a few hundred mb a day via a web service.
Poking around the code I couldn't see anyway to alter this behavior via a
property, does anyone have a better idea other than writing a cronjob to
look for /tmp/camel-tmp-* every day and nuking it?
On Thu, Jun 9, 2011 at 1:26 PM, Jason Burkhardt<[email protected]>wrote:
Hate to dredge up an old thread but I'm seeing this same behavior in 2.6.
Note: I am not calling stop or anything. This route processes a message
from JMS, calls http, processes the result and publishes it to JMS again.
This ends up writing tmp files with the soap response to
/tmp/camel-tmp-whatever as long as it is running with no apparent cleanup.
After running for a couple days this was over 1gb.
Gordon, did you ever find any useful solution?
--
View this message in context:
http://camel.465427.n5.nabble.com/http-not-cleaning-up-tmp-files-when-exchange-is-stopped-tp4269124p4473542.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang