I have 2 services S1 and S2. Calling S2 using annotated Feign client(@FeignClient) from S1. The issue is, I am unable to get traceId in S2.
But when I try to call S2 using RestTemplate it works.
Any help will be appreciated
Edited:
I have find out the cause actually I am using Feign.Builder below is sample code which builds fiegn client.
@ConditionalOnProperty(name = "feign.hystrix.enabled")
public Feign.Builder feignHystrixBuilder() {
SetterFactory setterFactory = new SetterFactory() {
@Override
public HystrixCommand.Setter create(Target<?> target, Method method) {
String groupKey = target.name();
String commandKey = target.name();
return HystrixCommand.Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey))
.andCommandKey(HystrixCommandKey.Factory.asKey(commandKey));
}
};
return HystrixFeign.builder().setterFactory(setterFactory);
}
Actually due to above config.. SleuthFeignHystrixBuilder is not invoked. I need to set HysterixCommandKey in my format.. thats why need above config.
How can it work with spring-sleuth ?