OpenFeign / OpenFeign/feign

Using fallbackfactory with feignclient with selected method implementation

Open
#681 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.