I have a feign client
@FeignClient(name = "client1")
public interface Client1 {
@GetMapping("/hello")
HelloResponse hello();
}
How can I get the name client1 within RequestInterceptor?
public class HelloInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
// how to get "client1" here?
}
}
requestTemplate.feignTarget().name()
This will give the client name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With