Skip to content

DefaultAsyncAutoConfiguration override a implicit AsyncTaskExecutor #313

@single-wolf

Description

@single-wolf

problem

spring-aop has a implicit rule for determining default AsyncExecutor when there`s no AsyncConfigurer existed

See AsyncExecutionAspectSupport.java#L227

DefaultAsyncAutoConfiguration will override it in the above case

@Configuration
@ConditionalOnMissingBean(AsyncConfigurer.class)
  static class DefaultTracedAsyncConfigurerSupport extends AsyncConfigurerSupport {
    @Autowired
    @Lazy
    private Tracer tracer;
    @Override
    public Executor getAsyncExecutor() {
      return new TracedExecutor(new SimpleAsyncTaskExecutor(), tracer);
    }
  }

version

java version "1.8.0_131"
spring-aop 4.3.11
opentracing-spring-cloud-core latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions