Reputation: 11
In my current scenario, I have an existing non-netty client that is sending a fixed message size (32 * 1024 bytes) to my existing non-netty server. I am in the process of changing my server to use Netty, I am unclear on the handlers I need to add to my pipeline before my business logic handler. If I am going to be using SSL, then I will add the SSL handler first in the pipeline and with my business logic handler being last. So what handlers do I need in the middle? Do I need a set size FrameDecoder (if that exists)? The message is not delimited by any characters, so I don't think I need to use DelimiterBasedFrameDecoder. Nor will I need to use a StringDecoder or StringEncoder.
…
…
pipeline.addLast("ssl", new SslHandler(engine));
// Anything to add here for fixed sized byte[] messages??????
// and finally add business logic handler
pipeline.addLast("handler", new BusinessLogicHandler());
…
…
For the bootstrap I have set the following options:
this.bootstrap.setOption("keepAlive", true);
this.bootstrap.setOption("sendBufferSize", 32*1024);
this.bootstrap.setOption("receiveBufferSize", 32*1024);
this.bootstrap.setOption("tcpNoDelay", true);
Do I need to set the writeBufferHighWaterMark option too?
Thank you
Upvotes: 1
Views: 630
Reputation: 23557
for fixed size messages you would add the FixedLengthFrameDecoder in front of your business handler.
See:
http://netty.io/3.6/api/org/jboss/netty/handler/codec/frame/FixedLengthFrameDecoder.html
Upvotes: 1