Нет перехватчика для ответа клиента Feign. Перехватчик запросов единственный доступный для клиента Feign.
Лучшим решением будет использование RestTemplate, а не Feign:
@Configuration
public class RestConfiguration {
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate
= new RestTemplate(
new BufferingClientHttpRequestFactory(
new SimpleClientHttpRequestFactory()
)
);
List<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors();
if (CollectionUtils.isEmpty(interceptors)) {
interceptors = new ArrayList<>();
}
interceptors.add(new UserRestTemplateClientInterceptor());
restTemplate.setInterceptors(interceptors);
return restTemplate;
}
}
И @Autowire restTemplate , где вы хотите использовать следующее:
@Autowire
RestTemplate restTemplate;