Thanks for pointing that out, I just created a JIRA[1] for it.

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

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 27, 2014 at 1:26:44 AM, Thibaut Robert (thibaut.rob...@gmail.com) 
wrote:
> Hi,
>  
> When using cxfRs to send a rest message in InOnly mode, Camel do not close
> the javax.ws.rs.core.Response object. As we are InOnly, the reponse object
> is not passed through the exchange, so the caller can not close it either.
>  
> Not calling close on the response maintain the input stream open (and the
> associated tcp connection) until it times out (or gc'ed), which is not
> desirable.
>  
> As a workaround I always use InOut mode and close the response, even if I'm
> not interested in the result.
>  
> Example (scala code):
>  
> val camel = new DefaultCamelContext().createProducerTemplate()
> val destination = "http://localhost:1234";
> val body = """{"key":"value"}"""
> // Leave an open connection
> //camel.sendBody("cxfrs:" + destination, body)
> // use instead:
> camel.requestBody("cxfrs:" + destination,
> body).asInstanceOf[Response].close()
>  
>  
> Is it possible to change this behaviour in Camel ?
>  
> Thanks
>  
> --
> Thibaut
>  

Reply via email to