@Bean public WebMvcRegistrationsAdapter webMvcRegistrationsAdapter() { return new WebMvcRegistrationsAdapter() { @Override public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { return new RequestMappingHandlerMapping() { @Override protected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping) { if (method.getDeclaringClass().isAnnotationPresent(SpringRestClientEnabled.class)) { return; // by pass SpringRestClientEnabled interface } super.registerHandlerMethod(handler, method, mapping); } }; } }; }
@Bean public WebMvcRegistrations feignWebRegistrations() { return new WebMvcRegistrationsAdapter() { @Override public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { return new FeignRequestMappingHandlerMapping(); } }; }
@Bean public WebMvcRegistrations feignWebRegistrations() { return new WebMvcRegistrationsAdapter() { @Override public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { return new RequestMappingHandlerMapping() { @Override protected boolean isHandler(Class<?> beanType) { return super.isHandler(beanType) && (AnnotationUtils.findAnnotation(beanType, FeignClient.class) == null); } }; } }; }