Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry Support in Hystrix #973

Closed
VikasJindal84 opened this issue Nov 13, 2015 · 2 comments
Closed

Retry Support in Hystrix #973

VikasJindal84 opened this issue Nov 13, 2015 · 2 comments

Comments

@VikasJindal84
Copy link

Hi,

Is there any support for retry in Hystrix .

I am invoking rest service using spring-cloud-feign . If rest-service is not available ,then i am using hystrix to call fallback method , it works perfectly.

Now i want a retry mechanism , so that failed rest call should be re-invoked after some time by some background process. Basically i am looking for something like this :


@Retry(retryCount = 2, fallbackMethod = "fallBackgreet")
public Greeting greet(String name) {
return greetingServiceFeignClient.greet(name);
}

public Greeting fallBackgreet(String name)  {
    Greeting greeting = new Greeting();
    greeting.setContent("Retry " + name);
    return greeting;
}

As you can see , i have developed my own retry annotation ,which invokes feign client in background , but i am looking for something standard instead of developing my own.

@mattrjacobs
Copy link
Contributor

@VikasJindal84 Hystrix treats the execution that gets wrapped as a black-box. Because only some executions benefit from a retry policy, Hystrix does not add the complexity of retry.

Internally at Netflix, each type of work that gets wrapped (HTTP/DB/Cache/etc) has different semantics and we do the work of configuring policies at the HTTP client/DB client/Cache client level and then wrapping with Hystrix.

@davidkarlsen
Copy link
Contributor

You could have a look at https://github.com/spring-projects/spring-retry as an alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants