@CircuitBreaker与spring-retry和@HystrixCommand与spring-cloud-starter-netflix-hystrix有什么区别?
他们俩似乎都实现了断路器的模式。
官方的Spring指南使用的是@HystrixCommand:
在他们的例子中:
@HystrixCommand(fallbackMethod = "reliable")
public String readingList() {
URI uri = URI.create("http://localhost:8090/recommended");
r
我在写入器上使用了一个spring batch重试。作者看起来像这样:
public class MyWriter implements ItemWriter<MyClass> {
@Retryable(maxAttempts=3, backoff=@Backoff(delay=2000))
public void write(List<? extends MyClass> list) throws Exception {
// db operation 1 -- insert query
// some business logic