camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Netty for TCP communication
Date Sun, 06 Mar 2011 10:26:11 GMT

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:;decoder=#myDecoder&amp;sync=true"/>

And check JBoss Netty documentation for how to write custom codecs

On Fri, Mar 4, 2011 at 7:39 PM, manoj.sahu <> 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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message