添加Maven依赖:

<dependency>
  <groupId>org.springframework.retry</groupId>
   <artifactId>spring-retry</artifactId>
   <version>1.1.0.RELEASE</version>
</dependency>

代码结构:

spring-retry的简单使用

源码:

 1 package Exception;
 2 
 3 /**
 4  * Created by zhengbin06 on 2017/2/14.
 5  */
 6 public class Clazz {
 7     private int i = 0;
 8     public Student getStudent() throws SException {
 9         if(++i != 3) {
10             System.out.println(i);
11             throw new SException();
12         }
13         return new Student();
14     }
15 }
Clazz.java

相关文章:

  • 2021-12-08
  • 2021-12-03
  • 2022-01-19
  • 2022-12-23
  • 2021-06-18
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-06-05
  • 2021-11-16
  • 2021-04-02
  • 2022-12-23
相关资源
相似解决方案