Using fallbackfactory with feignclient with selected method implementation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
Hi,
So I have one 'a-service' feign client as below:
@Feign(name="a-service", fallbackFactory = AServiceFallbackFactory.class)
public interface AService {
@GetMapping("/aservice/findAll")
public String findAll();
@GetMapping("/aservice/{param1}")
public String findOne(@PathVariable("param1") String param1);
}
AServiceFallbackFactory is creating and return an object of AServiceFallback. Since AServiceFallback is implementing AService interface, it has implemented both (findAll, findOne) methods.
My requirement is : I want to give fallback to only one method (say 'findAll') but let findOne fail if happened. Also, I want to catch cause to log and find out reason.
What could be the best way ?
Thanks in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the AService interface, AServiceFallbackFactory, and AServiceFallback described in the issue, then trace how fallback methods are selected and how the failure cause is passed. Determine whether findAll can use a fallback while findOne still fails, with the cause available for logging; the issue provides no named source files or tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100