question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hystrix fallbacks with Feign.

See original GitHub issue

https://github.com/Netflix/feign/issues/298 ,I like this

How about a fallback implementation of the interface?

public interface FooClient {
      void doSomething(String withArg);
}

public class FooFallback implements FooClient {
      public void doSomething(String withArg){
            System.out.println(withArg);
       }
}

@FeignClient(name="foo-client", fallback=FooFallback.class)       
public interface FeignFooClient extends FooClient {

    @Override
    @RequestMapping(method = RequestMethod.GET, value = "/something/{withArg}")
    void doSomething(String withArg);

}  

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
spencergibbcommented, Jan 20, 2016

@miguelfgar TestFallback must be a spring bean. Please open a new issue otherwise.

2reactions
satishgummadellicommented, Jan 28, 2016

@spencergibb , how can we access any exception from FiegnClient in the fallback class?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fallbacks with Spring Cloud Feign - Arnold Galovics
The concept of fallbacks is easy to understand. ... One way to implement a fallback for a Spring Cloud Feign client is to...
Read more >
Learning about Spring Cloud Feign and Hystrix Circuit Breaker
A Complete Guide about Spring Cloud Feign and Hystrix Circuit Breaker ... The Fallback method needs to have a matching signature in terms...
Read more >
Quick Understanding for Fallback in Spring Cloud Feign
The functionality for hystrix and resilience are somehow similar which help control the interaction between services by providing fault ...
Read more >
Feign Hystrix fallback not working - Stack Overflow
I found that I am not able to modify the hystrix timeout through property files. Even if I give, hystrix.command.default.execution.isolation.
Read more >
Handling HTTP client errors with Feign and Hystrix - Medium
Hystrix and the fallback classes are useful to deal with errors, in case we want to create retrying policies maybe we would need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found