当前位置: 首页 > news >正文

台州快速建站公司seo的基本步骤顺序正确的是

台州快速建站公司,seo的基本步骤顺序正确的是,网站备案才能使用,天猫店铺购买平台在Seata中,有4种分布式事务实现方案 XA、AT、TCC、Saga 其中XA利用了数据库的分布式事务特性,AT相当于框架去控制事务回滚。TCC手写三个方法,saga手写两个方法。 AT的性能和编写比较折中,是最常用的一种。TCC一些视频教程中介绍…

在Seata中,有4种分布式事务实现方案

XA、AT、TCC、Saga

其中XA利用了数据库的分布式事务特性,AT相当于框架去控制事务回滚。TCC手写三个方法,saga手写两个方法。

AT的性能和编写比较折中,是最常用的一种。TCC一些视频教程中介绍了单表单字段加中间表的方式存储过程数据,对于一次操作多个主子表数据的示例目前实现还是太繁琐了。

根据官方实例和相关视频简单写了下代码。

对于配置,能用默认的用默认,有示例配置的优先抄示例配置

1.加依赖

        <!-- 版本对应关系Alibaba 2021.0.5 对应 Seata 1.6.1https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E这里依赖不是 spring-cloud-alibaba-seata--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-seata</artifactId><version>2021.0.5.0</version></dependency>

这里alibaba版本是2021.0.5所以spring-cloud-starter-alibaba-seata也用这个版本,注意版本对应

2.写配置

seata:registry:type: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group: SEATA_GROUPcluster: default#事务组tx-service-group:  default_tx_groupservice:#事务组和集群名称映射vgroup-mapping:default_tx_group: defaultdata-source-proxy-mode: AT

注意,这里需要先配置好nacos和seata服务端,seata服务端早期是json配置的,新版的是yaml配置

seata服务端配置application.yml

#  Copyright 1999-2019 Seata.io Group.
#
#  Licensed 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.server:port: 7091spring:application:name: seata-serverlogging:config: classpath:logback-spring.xmlfile:path: ${log.home:${user.home}/logs/seata}extend:logstash-appender:destination: 127.0.0.1:4560kafka-appender:bootstrap-servers: 127.0.0.1:9092topic: logback_to_logstashconsole:user:username: seatapassword: seata
seata:config:# support: nacos, consul, apollo, zk, etcd3type: fileregistry:# support: nacos, eureka, redis, zk, consul, etcd3, sofatype: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group: SEATA_GROUPnamespace:cluster: defaultusername:password:context-path:store:# support: file 、 db 、 redismode: file
#  server:
#    service-port: 8091 #If not configured, the default is '${server.port} + 1000'security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login

3.写代码

将主调用的方法注解@Transactional改为@GlobalTransactional,其他微服务方法无需更改。

完整代码见顶部

http://www.ritt.cn/news/16373.html

相关文章:

  • python做的网站哪些搜狗网页搜索
  • 微网站开发平台有哪些营销推广案例
  • wordpress支持多域名百度seo排名帝搜软件
  • 可以做结构图的网站北京网络营销推广培训哪家好
  • 做网站应该了解什么软件互联网域名交易中心
  • 适合代码新手做的网站商品营销推广的方法有哪些
  • 时光轴 网站东营网站建设哪家更好
  • 网站屏蔽搜索引擎品牌软文
  • 哪里有学习网站建设2345网址导航官网下载
  • 中国建设银行网站e路外链网站推荐
  • liferay 做网站seo内容优化心得
  • 怎么在百度上做公司网站网络推广代理怎么做
  • 北京通信管理局网站备案处营销推广投放平台
  • 动态网站开发实训心得体会企业网站排名优化
  • 网站备案成功后该怎么做什么软件比百度搜索好
  • 苏州web网站建设微信小程序怎么开通
  • 专门做评论的网站百度营销
  • 深圳平价的专业建站公司百度登录入口官网
  • 有专门做序列图的网站关键词分析工具
  • 苏州建设监督网站开封网站推广公司
  • 修改网站参数重庆关键词排名推广
  • 新乡商城网站建设价格网络营销策划推广
  • 移动网站模板中国网站排名
  • 免费下载设计素材网站如何建立网站
  • 谷歌云做网站怎么在百度推广自己的网站
  • 国字类型网站有哪些内容百度竞价排名软件
  • wordpress开启多站点模式深圳seo论坛
  • 大同市住房城乡建设网站百度seo关键词工具
  • 没有域名可以做网站sem竞价
  • 医疗服务网站素材班级优化大师学生版