camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davsclaus <>
Subject Re: Request response with a tcp socket
Date Sun, 10 Feb 2008 11:46:39 GMT


Did you ever get a response or figured it out how to work with
request/response using TCP in Camel?

I am also trying to build a small sample that:
1. accepts incoming requests from TCP
2. processes the exchange
3. returns a response to step #1 at the TCP

However I haven't figured it out how to do IN/OUT with the Mina component.

doesn't return a response when I do the following test:

        CamelTemplate template = new CamelTemplate(context);

        String response = (String)
template.requestBody("mina:tcp://localhost:8888", "Hello Claus");
        System.out.println("Response is " + response);

I get this exception instead:

Exception in thread "main" org.apache.camel.RuntimeCamelException:
java.lang.RuntimeException: No response from server within 10000 millisecs
	at org.apache.camel.util.ProducerCache.send(
	at org.apache.camel.CamelTemplate.send(
	at org.apache.camel.CamelTemplate.sendBody(
	at org.apache.camel.CamelTemplate.sendBody(
	at org.apache.camel.CamelTemplate.requestBody(
	at dk.claus.camel.CamelFun.main(

Nicky Sandhu wrote:
> Use case of sending a message to a tcp port and reading the response. I
> tried this...maybe i am missing the point
> from("direct:a").to("mina:tcp://someserver:someport").to("direct:b")
> The expectation was to be able to create a producer on "direct:a" endpoint
> and consume an exchange with an in body = request message. Then assert
> that on "direct:b" end point it would receive an exchange with an outbody
> of the response.
> Instead I believe the component does something similar to http component
> and tries to host the socket in camel. 
> I can envision writing a component to do the above but I am not sure I
> want to duplicate existing functionality

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

View raw message