Spring boot Spring Cloud侦探正在断开授权安全上下文执行器

Spring boot Spring Cloud侦探正在断开授权安全上下文执行器,spring-boot,spring-security,spring-cloud,spring-cloud-sleuth,Spring Boot,Spring Security,Spring Cloud,Spring Cloud Sleuth,我有一个spring boot应用程序版本1.3.3.0,我还添加了spring Cloud Sleuth来获取这些跟踪功能。添加spring cloud sleuth后,我看到我的一些异步API在org.springframework.security.concurrent.DelegatingSecurityContextExecutor中传递时正在中断。为null。简而言之,我使用SpringSecurity中的org.springframework.security.concurrent

我有一个spring boot应用程序版本1.3.3.0,我还添加了spring Cloud Sleuth来获取这些跟踪功能。添加spring cloud sleuth后,我看到我的一些异步API在
org.springframework.security.concurrent.DelegatingSecurityContextExecutor中传递时正在中断。
为null。简而言之,我使用SpringSecurity中的
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
在不同的执行者之间传递安全上下文。为此,我只是在应用程序启动期间将这些执行器包装到
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
实例中。我不确定的是,为什么春季侦探会成为这里的一个问题。我们使用异步处理的方式是,我们创建了一个自定义注释,然后围绕该注释创建了一个切入点来注入异步行为

例如:

public class Async implements AsyncConfigurer {

 public Executor getCustomAsyncExecutor() {

   ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
   //all configuration for thread pool
   return new DelegatingSecurityContextAsyncTaskExecutor(executor);
 }

 public Executor getProcessingExecutor() {

   ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
   //all configuration for thread pool
   return new DelegatingSecurityContextAsyncTaskExecutor(executor);
 }

}

public class MyControllerClass {

@Autowired
private Executor myProcessingExecutor;

@MyCustomAsyncAnnotation
public ResponseObject getResponse() {
    //As soon as below code get's executed I get NPE as 

    //`org.springframework.security.concurrent.DelegatingSecurityContextExecutor.executor` is null. What I'm not sure is why it's null??

    // As you see above in my Async class I've registered executor in DelegatingSecurityContextAsyncTaskExecutor, then why it's null here?

//If I remove spring-cloud-sleuth code works fine once again.
      CompletableFuture.supplyAsync(() -> ..., myProcessingExecutor); 
   }
}

class MyCustomAspect {
private Executor myCustomAsyncExecutor;
//create point cut here for those method which have 
// @MyCustomAsyncAnnotionation and process it async via above executor.  
}


我使用的是spring boot 1.3.3.RELEASE、rest easy、spring security 4.0.3.RELEASE、spring cloud sleuth 1.0.12。RELEASE

@marcin grzejszczak您对此有什么建议吗?您是否检查了最新版本的Camden是否存在问题?(请注意,您将不得不颠簸靴子)。如果是这样的话,那就是一个bug,请在Github上提交一个问题,并请将您的示例也上传到Github,这样我就更容易复制它了。