I have
@FeignClient(name="verbservice", fallback = VerbClientFallback.class)
public interface VerbClient {
@GetMapping
public String getVerbWord();
}
and
@Component
public class VerbClientFallback implements VerbClient {
@Override
public String getVerbWord() {
return "fallback";
}
}
App
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableHystrix
public class SentenceAppApplication {
...}
Controller
@Autowired
private VerbClient verbClient;
....
return verbClient.getVerbWord() + ....other;
application.properties
feign.hystrix.enabled=true
Versions
Spring boot 2.5.4
<properties>
<java.version>11</java.version>
<spring-cloud.version>2020.0.3</spring-cloud.version>
</properties>
Goal: stop the verb service and see if fallback is invoked or not.
Problem:
nested exception is feign.RetryableException: Connection refused: no further information executing GET http://verbservice] with root cause
I tried steps in this link...but it is not working Feign Hystrix fallback not working
It seems the property
feign.hystrix.enabled=true
is changed to
feign.circuitbreaker.enabled=true