code: protected void startQueue() {
        if (executor == null) {
            logger.debug("Starting the receiving thread pool.");
            executor = new ThreadPoolExecutor(
                    numberOfWorkerThreads,
                    numberOfWorkerThreads,
                    threadKeepAliveTime, TimeUnit.SECONDS,
                    new LinkedBlockingQueue<Runnable>(),
                    getThreadFactory());
            executor.allowCoreThreadTimeOut(true);
            //Start with one thread, and build it up gradually as it needs.
            executor.prestartCoreThread();
            logger.info("ReceiveQueue started! Current pool size: {}", executor.getPoolSize());
        } else {
            if (executor.getCorePoolSize() < numberOfWorkerThreads) {
                //If the number has increased we need to set the max first, or we'll get an IllegalArgumentException
                executor.setMaximumPoolSize(numberOfWorkerThreads);
                executor.setCorePoolSize(numberOfWorkerThreads);
            } else if (executor.getCorePoolSize() > numberOfWorkerThreads) {
                //If the number has decreased we need to set the core first.
                executor.setCorePoolSize(numberOfWorkerThreads);
                executor.setMaximumPoolSize(numberOfWorkerThreads);
            }
            logger.info("ReceiveQueue running. Current pool size: {}. Current Queue size: {}",
                    executor.getPoolSize(), getQueueSize());
            logger.info("Nr of active pool-threads: {}", executor.getActiveCount());
        }
      }
docs: Starts the executor if it hasn't started yet, or updates the thread-pool size if it is started.