摘要: 在类上增加@Retryable注解 application 增加@EnableRetryable注解 value 判断何种报错 maxAttempts指最大重试次数 backoff 为延时时间 代码实例 int i=0;long startTime = System.currentTimeMilli 阅读全文
posted @ 2022-06-23 16:42 老小包的博客 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 问题原因:由于aop动态代丽问题,注解实例获取为代理类,导致注解不能正常使用导致此问题。 解决思路:手动获取实体类进行执行,使用application.getBean()方式获取 代码: @Slf4j@Componentpublic class SpringContextUtil implement 阅读全文
posted @ 2022-06-23 16:39 老小包的博客 阅读(810) 评论(0) 推荐(0) 编辑