Overlaping messages

Ernesto A. eaneiros at gmail.com
Thu Jul 2 16:20:41 EDT 2009


Hi,

I'm playing around with netty to see if we can use it to replace our
old network framework, based on its flexibility and the promise of
switching to nio with minimal effort should we need it. So far I have
encountered only one problem: we use a simple text protocol to
communicate between client and server, it consists of text fields
separated by a separator, we have the following setup for the channel
factory

...ChannelFactory:
pipeline.addLast("string_decoder", new StringDecoder());
pipeline.addLast("object_decoder", new OurObjectDecoder());

OurObjectDecoder class extends OneToOneDecoder, takes a string message
and parses it to produce a POJO. So far so good, but sometimes, not
always, a message would overlap over a previous message at the same
position always, and we end up receiving two messages in one, and
consequently failing to register and losing the second message.
However when I take my object decoder out of the pipeline chain and
handle the message directly on my business logic then I get the
messages one after the other without overlaping. Could it be two
internal netty threads modifying the ChannelBuffer concurrently? I'm
using netty 3.1.0.cr1, any feedback would be appreciated, thanks in
advance, Ernest.



More information about the netty-users mailing list