SpringCloud + Feign 事务不回滚 解决方案
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
看issue发现很多人也有这个问题,我最近也碰到了,然后跟踪了一下源码,总算解决了。
下面给出我的解决步骤:
1. 打开LCN Logger
`logging.level.com.codingapi.txlcn = debug`
2. 检查日志中是否包含以下log。如包含,转6
`com.codingapi.txlcn.tracing.Tracings : tracing apply group:693a5ae3226537.....`
3. 检查日志中的各服务log中groupId是否一致 。如一致,转6
`c.c.t.t.c.context.DefaultGlobalContext : Start TxContext[693a5ae3226537]`
4. 检查是否用了 @EnableWebMvc 注解。如用了,转6
5. 添加MVC拦截器
```
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
.........其它配置省略...........
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new SpringTracingApplier());
}
}
6. 结束
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.