Hi You need to develop a custom encoder and decoded to your custom codec. And then configure this on the Camel netty endpoint.
For example <bean id="myEncoder" class="xxx"/> <bean id="myDecoder" class="xxx"/> And in Camel route <from uri="netty:tcp:0.0.0.0:9123?encoder=#myEncoder&decoder=#myDecoder&sync=true"/> And check JBoss Netty documentation for how to write custom codecs http://www.jboss.org/netty/documentation.html On Fri, Mar 4, 2011 at 7:39 PM, manoj.sahu <[email protected]> wrote: > Hi - > I am using netty to send a request over a TCP socket. When I send the > request I need to send 2 bytes lengh of the message and then followed by an > XML payload. On response I am getting 2 bytes length and then XML payload. > I am assuming that I need to write a custom codec for it. Can someone give > me some pointer / sample code example. I am using netty in conjunction with > Apache Camel. > > I am using this as in my route : > netty:tcp://host:port/?sync=true&textline=true > > I am adding 2 bytes length by hand to the message payload. Using ByteBuffer. > I need to send using Big Endian network byte order. > > Thanks! > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Netty-for-TCP-communication-tp3409969p3409969.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
