This commit is contained in:
clay
2024-03-06 17:44:09 +08:00
commit adaec0eadd
1493 changed files with 219939 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>common</artifactId>
<groupId>cn.fateverse</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-seata</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.fateverse</groupId>
<artifactId>common-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-serializer-kryo</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,15 @@
package cn.fateverse.common.seata;
import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* @author Clay
* @date 2023-08-08
*/
@PropertySource(value = "classpath:seata-config.yml")
@EnableAutoDataSourceProxy
@Configuration(proxyBeanMethods = false)
public class SeataAutoConfiguration {
}

View File

@@ -0,0 +1 @@
#cn.fateverse.common.seata.SeataAutoConfiguration

View File

@@ -0,0 +1,56 @@
seata:
enabled: true
tx-service-group: default_tx_group # 事务群组(可以每个应用独立取名,也可以使用相同的名字)
client:
rm-report-success-enable: true
rm-table-meta-check-enable: false # 自动刷新缓存中的表结构默认false
rm-report-retry-count: 5 # 一阶段结果上报TC重试次数默认5
rm-async-commit-buffer-limit: 10000 # 异步提交缓存队列长度默认10000
rm:
lock:
lock-retry-internal: 10 # 校验或占用全局锁重试间隔默认10ms
lock-retry-times: 30 # 校验或占用全局锁重试次数默认30
lock-retry-policy-branch-rollback-on-conflict: true # 分支事务与其它全局回滚事务冲突时锁策略(优先释放本地锁让回滚成功)
tm-commit-retry-count: 3 # 一阶段全局提交结果上报TC重试次数默认1次建议大于1
tm-rollback-retry-count: 3 # 一阶段全局回滚结果上报TC重试次数默认1次建议大于1
undo:
data-validation: true # 二阶段回滚镜像校验默认true开启
log-serialization: kryo # undo序列化方式默认jackson 不支持 LocalDateTime
log-table: undo_log # 自定义undo表名默认undo_log
log:
exceptionRate: 100 # 日志异常输出概率默认100
support:
spring:
datasource-autoproxy: true
service:
vgroup-mapping:
pig_tx_group: default # TC 集群必须与seata-server保持一致
enable-degrade: false # 降级开关
disable-global-transaction: false # 禁用全局事务默认false
grouplist:
default: pig-seata:8091
transport:
shutdown:
wait: 3
thread-factory:
boss-thread-prefix: NettyBoss
worker-thread-prefix: NettyServerNIOWorker
server-executor-thread-prefix: NettyServerBizHandler
share-boss-worker: false
client-selector-thread-prefix: NettyClientSelector
client-selector-thread-size: 1
client-worker-thread-prefix: NettyClientWorkerThread
type: TCP
server: NIO
heartbeat: true
serialization: seata
compressor: none
enable-client-batch-send-request: true # 客户端事务消息请求是否批量合并发送默认true
registry:
file:
name: file.conf
type: file
config:
file:
name: file.conf
type: file