Hi Aki,

It makes sense. The httpExchange has bunch of onXXXX method to take care of it.
We should try to close the input stream when the exception is thrown.

I just filled a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-5621 

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Monday, September 17, 2012 at 5:55 PM, Aki Yoshida wrote:

> I think there is an issue in JettyHttpProducer.
> 
> public boolean process(Exchange exchange, final AsyncCallback callback) {
> JettyContentExchange httpExchange = null;
> try {
> httpExchange = createHttpExchange(exchange, callback);
> doSendExchange(client, httpExchange);
> } catch (Exception e) {
> // error occurred before we had a chance to go async
> // so set exception and invoke callback true
> exchange.setException(e);
> callback.done(true);
> return true;
> }
> 
> // we should continue processing this asynchronously
> return false;
> }
> 
> createHttpExchange(exchange, callback) may open an input stream and
> set it to httpExchange. When something goes wrong in doSendExchange,
> this input stream may not be closed. So, I put a finally block there
> which checks if the input stream in available in httpExchange and if
> so, closing it. That released the file. Or something of this kind
> could go into doSendExchange.
> 
> regards, aki
> 
> 2012/9/17 Kramer, Ulrich <u.kra...@sap.com (mailto:u.kra...@sap.com)>:
> > Hello!
> > 
> > in Apache Camel 2.10.1 the following route leaves the files in the source 
> > directory opened, if the destination is not reachable. Every second the 
> > number of opened files (lsof -p <pid>) is increased by 2.
> > 
> > from("file:/tmp/inbox").to(""jetty:http://localhost:12345/xxx";)
> > 
> > But the route
> > 
> > from("file:/tmp/inbox").throwException(new Exception("Test"))
> > 
> > works fine. Is this a bug? 


Reply via email to