spring boot 2.2 jdk 13

@FeignClient(contextId = "sp-producer-hystrix",name="SPRINGCLOUD-PRODUCER/producer",fallback= FeignHystrixFallback.class) public interface CusFeignHystrix extends CustomFeignHystrix { }

@RequestMapping("/feignHystrix") public interface CustomFeignHystrix { @GetMapping("/usl") public List usl(); }

@component public class FeignHystrixFallback implements CusFeignHystrix { protected Logger logger = LoggerFactory.getLogger(getClass()); @override public List usl() { logger.error("defeat--------------------------"); User temp = new User(); temp.setName("defeat+++++++++++++++++"); return List.of(temp); } } Error at startup Ambiguous mapping. Cannot map 'com.ciel.springcloudfathernewconsumer0.service.CusFeignHystrix' method com.ciel.springcloudfathernewconsumer0.service.CusFeignHystrix#usl() to {GET /feignHystrix/usl}: There is already 'feignHystrixFallback' bean method

I had to remove @component from FeignHystrixFallback But it happened No fallback instance of type class com.ciel.springcloudfathernewconsumer0.fallback.FeignHystrixFallback found for feign client sp-producer-hystrix

I finally solved it like this ; Overriding @GetMapping ("/usl") with @GetMapping ("/ gg")

@component public class FeignHystrixFallback implements CusFeignHystrix { protected Logger logger = LoggerFactory.getLogger(getClass()); @override @GetMapping("/gg") public List usl() { logger.error("defeat--------------"); User temp = new User(); temp.setName("defeat+++++++++++++++++"); return List.of(temp); } }

Comment From: OlgaMaciaszek

Hello, @cielswift Please learn how to properly format code and logs. Please provide a minimal, complete, verifiable example that reproduces the issue (link to a sample project repo and steps to reproduce the issue).

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.