1

Netty 3 makes use of ExecutionHandler which gives the ability to configure the system by passing in an Executor. For example an OrderedMemoryAwareThreadPoolExecutor can be used which allows ability to configure things like corePoolSize, maxChannelMemorySize, maxTotalMemorySize etc.

In Netty 4, ExecutionHandler has been removed In New and noteworthy in 4.0 it is mentioned to use DefaultEventExecutor but as far as I can see, this does not have the same level of configuration flexibility as the removed ExecutionHandler.

The question is how do one configure EventExecutor in Netty 4 like ExecutionHandler in Netty 3?

Finlay Weber
  • 2,989
  • 3
  • 17
  • 37

1 Answers1

0

In Netty 4 an event executor is assigned when a handler is added to the channel pipeline. For example:

https://netty.io/4.1/api/io/netty/channel/ChannelPipeline.html#addLast-io.netty.util.concurrent.EventExecutorGroup-java.lang.String-io.netty.channel.ChannelHandler-

Nicholas
  • 15,916
  • 4
  • 42
  • 66
  • That, I know how to do, and that is not what my question is about. For example if you read the documentation of OrderedMemoryAwareThreadPoolExecutor, you will see "A MemoryAwareThreadPoolExecutor which makes sure the events from the same Channel are executed sequentially. " - the question in, in Netty 4, if I want this sort of behaviour which components should I configure...which event executor in Netty 4 can provide this sort of behaviour – Finlay Weber Feb 14 '21 at 10:24
  • The DefaultEventExecutor will ensure the same semantics in terms of execution. – Norman Maurer Feb 14 '21 at 14:04
  • 1
    @NormanMaurer but how is that so when OrderedMemoryAwareThreadPoolExecutor provides lots more configuration opportunity. For example with OrderedMemoryAwareThreadPoolExecutor I can configure: corePoolSize, maxChannelMemorySize, maxTotalMemorySize, keepAliveTime, threadFactory...while DefaultEventExecutor provides different knobs. How can DefaultEventExecutor then be a drop-in replacement as you seem to be saying – Finlay Weber Feb 16 '21 at 07:33