From 5458d18351d3a982c195ee5251740a1d2ea466cd Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 18 Apr 2017 16:12:12 +0000 Subject: [PATCH] Sync docs from 1.1.x to gh-pages --- 1.1.x/index.html | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/1.1.x/index.html b/1.1.x/index.html index eb47909a5..bce608485 100644 --- a/1.1.x/index.html +++ b/1.1.x/index.html @@ -514,7 +514,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • Messaging
  • @@ -2521,6 +2525,36 @@ are creating Spans each time a new task is submitted, invoked or scheduled.

    tracer, traceKeys, spanNamer, "calculateTax")); +
    +
    Customization of Executors
    +
    +

    Sometimes you need to set up a custom instance of the AsyncExecutor. In the following snippet you +can see an example of how to set up such a custom Executor.

    +
    +
    +
    +
    @Configuration
    +@EnableAutoConfiguration
    +@EnableAsync
    +static class CustomExecutorConfig extends AsyncConfigurerSupport {
    +
    +	@Autowired BeanFactory beanFactory;
    +
    +	@Override public Executor getAsyncExecutor() {
    +		ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    +		// CUSTOMIZE HERE
    +		executor.setCorePoolSize(7);
    +		executor.setMaxPoolSize(42);
    +		executor.setQueueCapacity(11);
    +		executor.setThreadNamePrefix("MyExecutor-");
    +		// DON'T FORGET TO INITIALIZE
    +		executor.initialize();
    +		return new LazyTraceExecutor(this.beanFactory, executor);
    +	}
    +}
    +
    +
    +