我正在使用spring-cloud-sleuth-zipkin和spring-cloud-starter-sleuth作为依赖项。
当我呼叫netflix FeignClient呼叫时,TraceId发生变化...
import org.springframework.cloud.netflix.feign.FeignClient;
@FeignClient
public interface TesterClient {
@RequestLine("GET /testCall")
@Headers({"Authorization: Bearer {bearerToken}",
"Content-Type: application/json"})
ResponseEntity<Test> testMethod(@Param("bearerToken") String bearerToken);
}
@Bean
public TesterClient testerClient() {
return Feign.builder()
.decoder(new TestDecoder()).encoder(new TestEncoder())
.logLevel(Logger.Level.FULL).target(TesterClient.class,
this.testUrl);
}
当我致电TesterClient时,traceId会更改吗?我如何保留相同的traceId?