导言
项目环境:
Seata Server : 2.0
Seata Client: 2.0
Spring Cloud Alibaba: 2023.0.1.0
JDK: 17
最近在项目中使用Seata的时候出现以下问题:
具体表现为, 只要方法使用了分布式事务, 如果方法中出现异常(不管是业务异常还是其他异常) 最终的异常提示信息都是: try to proceed invocation error
, 导致业务异常提示信息无法响应给前端
参考issues: https://github.com/apache/incubator-seata/issues/6488
一. 问题原因
这个问题是由于Seata Client 的2.0 版本存在此bug,将项目中 Seata Client 的版本回退到1.8就好了
原本seata client 版本
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
回退后版本
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>1.8.0</version>
<scope>compile</scope>
</dependency>