You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by kai0411 <jo...@softechnics.com> on 2008/04/30 18:33:49 UTC

Using CAMEL/MINA for plain TCP communication tutorial

I'm following the tutorial in
http://servicemix.apache.org/35-using-other-camel-components.html to build a
TCP/IP BC using MINA.  
After some tests, we found that if we have (case one):

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {
              from("mina:tcp://localhost:8803")                                                
                      .convertBodyTo(String.class)
                      .to("log:tutorial-string");
   }
}

then nothing would be posted to ServiceMix console no matter what is send to
port 8803. Even directly telnet to port doesn't work.

If we have (case two):

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {
         from("timer://tutorial?fixedRate=true&period=10000")          
                 .setBody(constant("<message>hello world</message>"))      
                 .to("mina:tcp://localhost:8803");                        
  }
}

then we can receive xxxxxx<message>hello world</message>, where xxxxxxx is
something unprintable characters.

So we guess that in above mentioned 'case one' the IoHandler is expecting
some kind of special 'protocol' as it happens in case two, it does receive
the data I send, but can't handle it. How do I fix it?  How do I write my
own IoHandler?

-- 
View this message in context: http://www.nabble.com/Using-CAMEL-MINA-for-plain-TCP-communication-tutorial-tp16986752s22882p16986752.html
Sent from the Camel - Development mailing list archive at Nabble.com.