On Mon, May 5, 2014 at 4:11 PM, Cecilio Alvarez <cecilio.alva...@hotmail.com> wrote: > Hi, > > I'm sending a 100 bytes array to a netty consumer. > Is there a way to post a message in the route each 100 bytes received? > > I tried with a FixedLengthFrameDecoder of 100 bytes, but sometimes I receive > more than 100 bytes. > > > <from > uri="netty:tcp://ip:9001?decoders=#string-decoder,#length-decoder&receiveBufferSize=100"/> > > > <bean id="string-decoder" > class="org.jboss.netty.handler.codec.string.StringDecoder"/> > > > <bean id="length-decoder" > class="org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder"> > <constructor-arg value="100"/> > </bean> > > > Thanks. >
Hi I think you need to figure out what protocol are in use. If you receive more than 100 bytes, then maybe its part of next message, or maybe you are not using an exact fixed length of 100 bytes, but maybe have a variable length, but use some special end bytes to indicate end of the message. > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Netty-consumer-fixed-message-size-tp5750868.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/