我试着关注"https://github.com/spring-cloud/spring-cloud-sleuth/issues/124“(https://github.com/spring-cloud-samples/brewery/blob/master/brewing/src/main/java/io/spring/cloud/samples/brewery/bottling/BottlingConfiguration.java#L30),但是没有帮助。loadBalancerInterceptor不会添加到AsyncRestTemplate中。当我调试时,我发现拦截器是在“创建”所有bean之后添加/注册的-所以在RestTemplate之后和@Loadbalanced拦截器被添加之前就会立即创建AsyncRestTemplate。
发布于 2017-04-19 21:33:18
您没有将AsyncRestTemplate包装在跟踪表示中。检查docs - cloud.spring.io/spring-cloud-sleuth/1.1.x/#_multiple_asynchronous_rest_templates的这一部分(我昨天添加了它)。
更新:
这个PR https://github.com/spring-cloud/spring-cloud-commons/pull/149在Dalston版本中完全修复了AsyncRestTemplate的问题。
https://stackoverflow.com/questions/43481580
复制相似问题