From 3e5ba0d34245444decb54a126ab835f74409e915 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 18 Apr 2017 16:12:05 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud-sleuth.html | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/spring-cloud-sleuth.html b/spring-cloud-sleuth.html index 3a4e7772e..97c249f0d 100644 --- a/spring-cloud-sleuth.html +++ b/spring-cloud-sleuth.html @@ -533,7 +533,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • Messaging
  • @@ -2912,6 +2916,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);
    +	}
    +}
    +
    +
    +