Thanks for the info. it's still little bit vague for me. can you please give
me a sample route which would do it at high level.I can use camel 2.2 if
needed. my Message header would have a correlation id so that should not be
problem. here is the sample route for the scenario I am looking for. here I
want all responses to be written to a file without requests waiting for
replies.

                from("file:///test/test/request") 
                .convertBodyTo(String.class).threads(1) 
                .to("mina:tcp://localhost:6202?sync=false&textline=true")
                .to("vm:response");

                          from("vm:response")
                .to("file:///test/test/response?fileName=response_async.txt");



huntc wrote:
> 
> Firstly if you need to guarantee just one tcp connection as per a
> connection-oriented protocol then you'll need to follow this recipe:
> 
> http://camel.apache.org/fine-grained-control-over-a-channel.html
> 
> You can send multiple requests by reading from a queue (perhaps consider
> using a 
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
> ConcurrentLinkedQueue  i.e. poll the queue until there's nothing left on
> it.
> 
> Meanwhile you'll need another thread to obtain a polling consumer from the
> same endpoint and poll with a timeout. Of course your protocol will have
> to support some form of correlation id so that you can match your
> responses back to your requests.
> 
> That should do the trick.
> 

-- 
View this message in context: 
http://old.nabble.com/single-tcp-connection-with-async-requests-and-async-responses-tp27850137p27857688.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to