@menacher I wonder why you not can just pass the thread count in by your own ? The problem is that there is not a good "default" value as it really depends on how many NioEventLoopGroups you create and what they do.
 @normanmaurer Agreed. But normally when you pass in 0 or -ve to such api it goes for a default silently rather than throwing back an exception. The one use I could see is that when using different machines to deploy same code, sending in 0 automatically ends up using the right number of threads, without me having to tweak them on each machine (for production I will need to tweak for sure, am talking about dev and test).
 @menacher I think the problem is that there is no good default as it depends on how many NioEventLoopGroup you create..
 Although I agree with @normanmaurer that there's no sane default in most cases, but I accepted @menacher's suggestion because it's also sometimes pretty useful.

Spring instantiation of NioEventLoopGroup with 0 number of threads is now complicated
I used to use the following constructor while instantiating `NioEventLoopGroup` boss and worker threads.    

``` java
/**
     * Create a new instance using nThreads number of threads, the given {@link ThreadFactory} and the
     * {@link SelectorProvider} which is returned by {@link SelectorProvider#provider()}.
     */
    public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory) {
        this(nThreads, threadFactory, SelectorProvider.provider());
    }
```

The issue is that when instantiating from spring, earlier I used to give nThreads = 0 and it would take the default number. But now its throwing `IllegalArgumentException`. Reason I instantiate via spring is so that I can pass in my own `ThreadFactory`.  
It would be good if a condition is kept inside this constructor checking for 0 and then passing the default value of threads. Or have another constructor which takes `ThreadFactory` alone and does the same logic.

transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java
transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java
diff --git a/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java b/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java
index 04d89b68fac..d11bb12865f 100644
--- a/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java
+++ b/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java
@@ -58,7 +58,7 @@ public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory) {
      */
     public NioEventLoopGroup(
             int nThreads, ThreadFactory threadFactory, final SelectorProvider selectorProvider) {
-        super(nThreads, threadFactory, selectorProvider);
+        super((nThreads == 0 ? DEFAULT_EVENT_LOOP_THREADS : nThreads), threadFactory, selectorProvider);
     }
 
     /**
