spring cloud 整合 seata1.4.2

1.参数说明

https://github.com/seata/seata/blob/develop/script/config-center/config.txt

Seata 参数配置

2.表结构

​​​​​​https://github.com/seata/seata/blob/develop/script/server/db/mysql.sql

3.pom

1.依赖seata-spring-boot-starter,支持yml、properties配置(.conf可删除),内部已依赖seata-all
2.依赖spring-cloud-alibaba-seata,内部集成了seata,并实现了xid传递        
		<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-seata</artifactId>
            <version>2.2.0.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>io.seata</groupId>
                    <artifactId>seata-spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.seata</groupId>
            <artifactId>seata-spring-boot-starter</artifactId>
            <version>1.4.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>druid</artifactId>
                    <groupId>com.alibaba</groupId>
                </exclusion>
            </exclusions>
        </dependency>

4.yml(可以直接放在nacos对应的配置信息里面)

seata:
  tx-service-group: yg_tx_group #与config.txt 中的service.vgroupMapping.yg_tx_group=default一致
  service:
    vgroup-mapping:
      yg_tx_group: default #与config.txt 中的service.vgroupMapping.yg_tx_group=default一致
    grouplist:
      default: ip:8091 #seata 服务地址

5.seata-server服务注册参数配置

registry {
  # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  type = "nacos"

  nacos {
    application = "seata-server"
    serverAddr = "ip:18848"
    group = "dev_seata_group"
    namespace = "dev_namespace"
    cluster = "default"
    username = "nacos"
    password = "nacos"
  }
}

config {
  # file、nacos 、apollo、zk、consul、etcd3
  type = "nacos"

  nacos {
    serverAddr = "ip:18848"
    namespace = "dev_namespace"
    group = "dev_seata_group"
    username = "nacos"
    password = "nacos"
    dataId = "seataServer.properties"
  }
}

6.seataServer.properties

参照1

7.日期类型不支持对应解决方案

LocalDateTime转换异常,springboot版本:2.4.4 · Issue #3620 · seata/seata · GitHub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值