camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huntc <hu...@mac.com>
Subject Re: single tcp connection with async requests and async responses
Date Thu, 11 Mar 2010 00:25:32 GMT

I do not recommend extending the MINA component. My recommendation is for you
to roll your own component from scratch. This component should obtain the
MINA endpoint and invoke its consumers and producers.

You could do this within a Processor but writing a component should
structure your code more nicely.

More on writing components here:
http://camel.apache.org/writing-components.html

In summary consider:
* writing MINA encoders/decoders for your protocol (depending on the
complexity of your protocol)
* write a component that utilises a MINA component which in turn optionally
utilises the encoders and decoders

That way your route code becomes something like:

from("file:///test/test/response") 
  .convertBodyTo(String.class)
  .to("mycomponent://localhost:6202"); 
                
from("mycomponent://localhost:6202") 
  .to("log:+++ reply++++"); 

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


Mime
View raw message