Coder Social home page Coder Social logo

Comments (7)

marcolenzo avatar marcolenzo commented on June 18, 2024

An option (maybe not clean) would be to have the SpringLBClientFactory take care of resetting the retry handlers.

@Override
public LBClient create(String clientName) {
    IClientConfig config = factory.getClientConfig(clientName);
    ILoadBalancer lb = factory.getLoadBalancer(clientName);
    LBClient client = LBClient.create(lb, config);
    client.setRetryHandler(new DefaultLoadBalancerRetryHandler(config));
    return client;
}

from spring-cloud-openfeign.

spencergibb avatar spencergibb commented on June 18, 2024

@marcolenzo I wouldn't do new DefaultLoadBalancerRetryHandler(config), but use factory.getInstance(clientName, RetryHandler.class) and have the default be a DefaultLoadBalancerRetryHandler. You could then customize via the normal ribbon customization methods. WDYT?

from spring-cloud-openfeign.

codependent avatar codependent commented on June 18, 2024

@marcolenzo @spencergibb Hi! I just found this issue that kind of describes what is happening to me. I was expecting that when there's a failure FeignClients would retry calling another instance of the same microservice in the next available server instead of just failing.

What actually happens is that it responds with an error 500. The following requests will be executed by the non-failing server, which is cool. However, it would be even better that it never failed and retried the operation in the next server. Is it supposed to work that way?

EDIT: I just realized my problem had to do with HystrixFeign configuration: my client had a 1 second timeout that didn't allow the load balancer to have enough time to call the next service. I increased its value and now it works as expected.

hystrix:
  command:
    getImage:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000

I am still wondering what the role of Feign's Retryer is, though. Since we have Ribbons retry configuration, it's kind of useless, isn't it?

from spring-cloud-openfeign.

rozhok avatar rozhok commented on June 18, 2024

Seems that it's fixed in 1.1.x branches, see CachingSpringLoadBalancerFactory

from spring-cloud-openfeign.

ryanjbaxter avatar ryanjbaxter commented on June 18, 2024

Can you please try with the latest Spring Cloud release? The retry functionality has been completely rewritten since this issue was opened?

from spring-cloud-openfeign.

spring-projects-issues avatar spring-projects-issues commented on June 18, 2024

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.

from spring-cloud-openfeign.

spring-projects-issues avatar spring-projects-issues commented on June 18, 2024

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.

from spring-cloud-openfeign.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.