Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultAsyncAutoConfiguration override a implicit AsyncTaskExecutor #313

Open
single-wolf opened this issue Jan 20, 2021 · 0 comments
Open

Comments

@single-wolf
Copy link

single-wolf commented Jan 20, 2021

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

single-wolf added a commit to single-wolf/java-spring-cloud that referenced this issue Jan 20, 2021
single-wolf added a commit to single-wolf/java-spring-cloud that referenced this issue Feb 3, 2021
single-wolf added a commit to single-wolf/java-spring-cloud that referenced this issue Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant