1 Spring Cloud Alibaba使用seata
1.1 Spring Cloud Alibaba版本依赖
< dependency>
< groupId> com. alibaba. cloud< / groupId>
< artifactId> spring- cloud- alibaba- dependencies< / artifactId>
< version> 2.2 .1 . RELEASE< / version>
< type> pom< / type>
< scope> import < / scope>
< / dependency>
1.2 seata 依赖
< ! -- seata -- >
< dependency>
< groupId> com. alibaba. cloud< / groupId>
< artifactId> spring- cloud- starter- alibaba- seata< / artifactId>
< / dependency>
1.3 判断使用哪个版本seata
在引入上面的依赖后,会自动导入下面的 seata-all 这个包,这个包的版本是选择seata版本最佳选择,各个版本的包各不相同
1.4 在判断使用哪个版本最佳后,可以下载seata服务器了
seata下载连接
1.5 直接解压即可
2 seata相关配置
2.1 配置文件
2.1.1 registry.conf:指明配置的注册中心,参数配置文件
registry {
type = "nacos"
nacos {
serverAddr = "localhost:8848"
namespace = ""
cluster = "default"
}
eureka {
serviceUrl = "http://localhost:8761/eureka"
application = "default"
weight = "1"
}
redis {
serverAddr = "localhost:6379"
db = "0"
}
zk {
cluster = "default"
serverAddr