Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.13 KB

sbe-core-retry.md

File metadata and controls

47 lines (30 loc) · 1.13 KB

SpringBootTutorial :: Core :: Retry

简介

开启 Retry

使用 @EnableRetry 注解开启 Retry 功能。

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.retry.annotation.EnableRetry;

@EnableRetry
@SpringBootApplication
public class SbeCoreRetryApplication {
    public static void main(String[] args) {
        SpringApplication.run(SbeCoreRetryApplication.class, args);
    }
}

@Retryable

使用 @Retryable 注解修饰方法

源码

完整示例:源码

引申和引用

引申

参考