1 Star 0 Fork 14

liuqian516922/spring-boot-2.2.5.snapshot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
retry.groovy 461 Bytes
一键复制 编辑 原始数据 按行查看 历史
邓澎波 提交于 2022-02-13 23:35 +08:00 . 提交了代码
package org.test
@EnableRetry
@Component
class Example implements CommandLineRunner {
@Autowired
private MyService myService
void run(String... args) {
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/retry.groovy')}"
}
}
@Service
class MyService {
static int count = 0
@Retryable
String sayWorld() {
if (count++==0) {
throw new IllegalStateException("Planned")
}
return "World!"
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuqian516922/spring-boot-2.2.5.snapshot.git
git@gitee.com:liuqian516922/spring-boot-2.2.5.snapshot.git
liuqian516922
spring-boot-2.2.5.snapshot
spring-boot-2.2.5.snapshot
master

搜索帮助

371d5123 14472233 46e8bd33 14472233