My Netty channel handler channelClosed ()
is get blocked while another message being received at messageReceived()
.
I used OrderedMemoryAwareThreadPoolExecutor
for synchronising messages.
Is channelClosed()
processed by low priority thread.?
Could you please tell about thread priority in netty. Thank you
objChannelPipeline.addLast("ipFilter", objCustomIPFilterHandler);
objChannelPipeline.addLast("idleHandler", new IdleStateHandler(timer,5,5, 0));
objChannelPipeline.addLast("loggingHandler", objLoggingHandler);
objChannelPipeline.addLast("frameDecoder",
new DelimiterBasedFrameDecoder(Integer.MAX_VALUE, false, ChannelBuffers.copiedBuffer("\n\n".getBytes(CharsetUtil.UTF_8))));
objChannelPipeline.addLast("messageDecoder", new CustomMessageDecoder());
objChannelPipeline.addLast("groupOrder", executionHandler);
objChannelPipeline.addLast("ProtocolMultiplexer", CustomHandler);
I guess this is because you are using OrderedMemoryAwareThreadPoolExecutor
, in this case events will be executed in the order in which they happen. Hence messageReceived()
will always execute before channelClose()
.
So if you have received 3 message received and after that the channel is closed, then first three times messageReceived
will be executed and after that only channelClose()
will be executed.
If you use MemoryAwareThreadPoolExecutor
than in this case channelClose
can get invoked before messageReceived()
as here the execution of events are not ordered.
Hope this helps !!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With