camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jhcha <>
Subject Bug at the camel-http component
Date Wed, 28 May 2008 12:10:01 GMT

Dear Camel Developer 

I has found the bug in camel-http component. 

At first I posted the mail of the title, "what is the difference between
requestBodyAndHeader and sendBodyAndHeader method ?" and some other mails.

I tried to know what happened in the camel for myself. 
and I had found the hang at the third http request call after the second
http request call.

Namely, the third http request call always hanged in all camel http request
method (template.sendBody, template.requestBody ...) 

So, I has found the camel http component source skipped the http connection
release call  documented at the http client threading docuemnt 

that is why the third http request hangs. 

The http client connection pool has the default connections 2.

Maybe and must be included http
client connection release method call after

I upload my patched source. 

Would you check the camel-http componet source and patch it.

The below source is my test source.
import org.apache.camel.CamelContext;
import org.apache.camel.CamelTemplate;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.DefaultExchange;

public class JettyRequestTest {

	public static void main(String[] args) throws Exception {

		JettyRequestTest client = new JettyRequestTest();

	public void testJettyRequest() throws Exception {
		try {
			CamelContext ctx = new DefaultCamelContext();

			RouteBuilder builder = new ServerRoutes();


			CamelTemplate<DefaultExchange> template = new

			String body = "<hello>world!</hello>";

			template.requestBody("direct:start", body);
			// ok
			template.requestBody("direct:start", body);
			// ok
			template.requestBody("direct:start", body);
			// --> hang

		} catch (Throwable e) {

class ServerRoutes extends RouteBuilder {

	public void configure() throws Exception {
		// 본문 수신 및 응답
		Processor proc = new Processor() {
			public void process(Exchange exchange) throws Exception {
				String request = exchange.getIn().getBody(String.class);
				exchange.getOut(true).setBody(request + " >> processed");



Thanks a lot

J. H. Cha

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message