Re: Netty consumer fixed message size.

2014-05-06 Thread Cecilio Alvarez
Thanks Claus for your answer.

I'm sure I'm sending blocks of 100 bytes. 
You are right, sometimes is posting to the route two or more of this blocks
together.
Is there a way to ensure that each 100 bytes received, the netty component
will post a new message?
Or I have to create a custom decoder with a variable length as you
suggested?

Thanks you in advance.





--
View this message in context: 
http://camel.465427.n5.nabble.com/Netty-consumer-fixed-message-size-tp5750868p5750895.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Netty consumer fixed message size.

2014-05-06 Thread Claus Ibsen
Hi

Its more of a netty question than Camel. You need to use a netty codec
that matches the protcol you use for the data transfer. Is it 100
fixed length, or is it something else. eg how do you know when you got
all the data for a single message.

There is some out of  the box codec's for fixed length, line
terminator etc codecs that netty/camel supports.

On Tue, May 6, 2014 at 9:08 AM, Cecilio Alvarez
cecilio.alva...@hotmail.com wrote:
 Thanks Claus for your answer.

 I'm sure I'm sending blocks of 100 bytes.
 You are right, sometimes is posting to the route two or more of this blocks
 together.
 Is there a way to ensure that each 100 bytes received, the netty component
 will post a new message?
 Or I have to create a custom decoder with a variable length as you
 suggested?

 Thanks you in advance.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Netty-consumer-fixed-message-size-tp5750868p5750895.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/


Re: Netty consumer fixed message size.

2014-05-06 Thread Cecilio Alvarez
Hi,

thanks again claus.

My idea was to send first a 100 length packet with the number of (100
length) packets, post them individually in the route and aggregate them. 









--
View this message in context: 
http://camel.465427.n5.nabble.com/Netty-consumer-fixed-message-size-tp5750868p5750923.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Netty consumer fixed message size.

2014-05-05 Thread Cecilio Alvarez
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-decoderamp;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.



--
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.


Re: Netty consumer fixed message size.

2014-05-05 Thread Claus Ibsen
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-decoderreceiveBufferSize=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/