// use ordered thread pool, to ensure we process the events in order, and can send back
// replies in the expected order. eg this is required by TCP.
// and use a Camel thread factory so we have consistent thread namings
// we should use a shared thread pool as recommended by Netty
String pattern = getCamelContext().getExecutorServiceManager().getThreadNamePattern();
ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
return new OrderedMemoryAwareThreadPoolExecutor(configuration.getMaximumPoolSize(),
0L, 0L, 30, TimeUnit.SECONDS, factory);
}