seata和postgresql和springcloud整合
发布日期:2021-05-06 22:37:55 浏览次数:17 分类:技术文章

本文共 2308 字,大约阅读时间需要 7 分钟。

第一步导入坐标

org.postgresql
postgresql
runtime
com.alibaba
druid-spring-boot-starter
1.1.10
com.baomidou
mybatis-plus-boot-starter
3.2.0
com.alibaba.cloud
spring-cloud-alibaba-seata
2.2.0.RELEASE
io.seata
seata-spring-boot-starter
io.seata
seata-spring-boot-starter
1.3.0

第二步增加seata配置

seata:  enabled: true  application-id: demo  tx-service-group: my_test_tx_group  enable-auto-data-source-proxy: true  config:    type: nacos    nacos:      namespace:      server-addr: 192.168.101.50:8848      group: SEATA_GROUP      username: nacos      password: nacos  registry:    type: nacos    nacos:      application: seata-server      server-addr: 192.168.101.50:8848      namespace:      username: nacos      password: nacos

第三步resources下增加seata.conf文件

## ---------------------------------------------------------------------------## Licensed to the Apache Software Foundation (ASF) under one or more## contributor license agreements.  See the NOTICE file distributed with## this work for additional information regarding copyright ownership.## The ASF licenses this file to You under the Apache License, Version 2.0## (the "License"); you may not use this file except in compliance with## the License.  You may obtain a copy of the License at####      http://www.apache.org/licenses/LICENSE-2.0#### Unless required by applicable law or agreed to in writing, software## distributed under the License is distributed on an "AS IS" BASIS,## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.## See the License for the specific language governing permissions and## limitations under the License.## ---------------------------------------------------------------------------client {
##这是唯一的和项目名保持一致 application.id = demo transaction.service.group = my_test_tx_group}
上一篇:NIO
下一篇:seata和sharding和postgresql整合

发表评论

最新留言

很好
[***.229.124.182]2025年03月31日 13时24分36秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章