Hi.
Here is the scenario:
public static void main(String[] args) throws Exception {
        BasicConfigurator.configure();
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(new RouteBuilder() {
            public void configure() throws Exception {
                from(new BeanEndpoint())
                        .threads(4)
                        .threadName("t1")
                        .process(new AsyncProcessor() {
                            public boolean process(Exchange exchange,
AsyncCallback callback) {
                                try {
                                    process(exchange);
                                } catch (Exception e) {}
                                callback.done(false);
                                return false;
                            }
                            public void process(Exchange exchange) throws
Exception {}
                        })
                        .threads(0)
                        .maxPoolSize(2)
                        .threadName("t2")
                        .maxQueueSize(0)
                        .process(new AsyncProcessor() {
                            public boolean process(Exchange exchange,
AsyncCallback callback) {
                                try {
                                    process(exchange);
                                } catch (Exception e) {}
                                callback.done(false);
                                return false;
                            }

                            public void process(Exchange exchange) throws
Exception {}
                        })
                        .to(new BeanEndpoint());

            }});
            context.start();
        }
    }


In the log I see the following:

737 [main] DEBUG org.apache.camel.impl.DefaultExecutorServiceStrategy  -
Created new thread pool for source:
threads[[process[com.sybase365.cameltest2$...@49dc423f],
threads[[process[com.sybase365.cameltest2$...@1b815bfb], To[bean:null]]]]]
with name: t1. [poolSize=4, maxPoolSize=6, keepAliveTime=60 SECONDS,
maxQueueSize=1,
rejectedexecutionhandler=java.util.concurrent.threadpoolexecutor$callerrunspol...@63b0bdc8,
daemon=true] -> java.util.concurrent.threadpoolexecu...@12b754b2
...
907 [main] DEBUG org.apache.camel.impl.DefaultExecutorServiceStrategy  -
Created new thread pool for source:
threads[[process[com.sybase365.cameltest2$...@1b815bfb], To[bean:null]]]
with name: t2. [poolSize=10, maxPoolSize=20, keepAliveTime=60 SECONDS,
maxQueueSize=1000,
rejectedexecutionhandler=java.util.concurrent.threadpoolexecutor$callerrunspol...@69d95da8,
daemon=false] -> java.util.concurrent.threadpoolexecu...@50d17ec3

The first Executor is configured as specified; the second Executor uses only
thread name "t2",
but  why did't it use the rest of configuration parameters?

Thanks,
Sergey.


-- 
View this message in context: 
http://camel.465427.n5.nabble.com/ThreadPoolExecutor-configuration-tp3207845p3207845.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to