Skip to content
Merged

Dev #259

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
13f4779
tracing 工具
ujued Feb 11, 2019
a0115b3
TM 支持docker构建和运行的代码和文档
johnnywjh Feb 11, 2019
60a1937
TM docker build 文档修改
johnnywjh Feb 11, 2019
3cc503c
TM docker build 文档修改
johnnywjh Feb 11, 2019
4424a0e
DTXLock 超时时间
ujued Feb 11, 2019
2d885e5
Delegate
Feb 11, 2019
7b89035
Merge pull request #241 from sesamekim/tm--docker.build
xlorne Feb 11, 2019
d6c662e
TXC模式,撤销SQL业务失败上报TM
ujued Feb 11, 2019
22bfe33
Merge branch '5.0.0.dev' of https://github.com/codingapi/tx-lcn into …
ujued Feb 11, 2019
cc1357b
TXC模式,撤销SQL业务失败上报TM
ujued Feb 11, 2019
c017b2d
TXC模式,撤销SQL业务失败上报TM
ujued Feb 11, 2019
2c0a590
fixed bug.
ujued Feb 11, 2019
fe2432c
fixed txc bug.
ujued Feb 11, 2019
83e69c9
TM docker build 文档修改
johnnywjh Feb 11, 2019
6524044
TM docker build 文档修改,之前的参数写错了
johnnywjh Feb 11, 2019
410aed5
TM docker build 文档修改
johnnywjh Feb 11, 2019
527b982
maven repo link
ujued Feb 11, 2019
81cc365
maven repo link
ujued Feb 11, 2019
15eea7a
Merge pull request #243 from sesamekim/tm--docker.build
xlorne Feb 11, 2019
222b0f3
dev
xlorne Feb 11, 2019
543b078
TM异常信息添加备注字段
ujued Feb 12, 2019
21d1877
异常TransactionInfo清理
ujued Feb 12, 2019
b17febd
tcc groupId的获取
ujued Feb 12, 2019
aa79ab7
注释
ujued Feb 12, 2019
bdb89c4
fix tracing of restTemplate .
ujued Feb 13, 2019
7cf35c2
Guava
xlorne Feb 13, 2019
7e4ddd1
注释
ujued Feb 14, 2019
b616114
Delegate
Feb 14, 2019
b31c263
Merge pull request #244 from codingapi/test
xlorne Feb 14, 2019
deaaf19
fixed #245
ujued Feb 14, 2019
302a183
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
ujued Feb 14, 2019
e089207
tm use spring data jpa
meetzy Feb 14, 2019
9fc055a
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
meetzy Feb 14, 2019
3cfae80
fixed #247
meetzy Feb 14, 2019
181e16b
fixed #247
meetzy Feb 14, 2019
b4f4953
common Maps
ujued Feb 14, 2019
b4b0640
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
ujued Feb 14, 2019
7e7c546
fixed #247
meetzy Feb 14, 2019
80a3392
labelName TC标识名称
Feb 14, 2019
cfac55f
mybatis pom
Feb 14, 2019
22c7401
TC modId provider.
ujued Feb 14, 2019
1f88c94
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
ujued Feb 14, 2019
940e535
fixed #249
ujued Feb 14, 2019
6c015bc
fixed #129
ujued Feb 15, 2019
7e60dc4
fix #129
ujued Feb 15, 2019
7fb4b04
注释
ujued Feb 15, 2019
0dfc7e7
注释
meetzy Feb 15, 2019
1f807c0
注释
meetzy Feb 15, 2019
1a40127
clean
meetzy Feb 15, 2019
3025552
Update pom.xml
hackcater Feb 15, 2019
c37d5c2
Update Dockerfile
hackcater Feb 15, 2019
4e33965
Update tm.docker.build.md
hackcater Feb 15, 2019
2812a19
fixed #246
ujued Feb 15, 2019
daf47c9
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
ujued Feb 15, 2019
71a14ae
upgrade tx tracing
ujued Feb 17, 2019
d813e7c
TM 后台更新
ujued Feb 18, 2019
90f9199
TM 后台更新
ujued Feb 18, 2019
251f4ef
log
ujued Feb 18, 2019
3cadf08
table ...
meetzy Feb 19, 2019
d5a97e1
moduleName.equals(getModuleName(channel))
Feb 20, 2019
5388379
long type bug.
ujued Feb 20, 2019
a9e72cf
Merge branch 'dev' of https://github.com/codingapi/tx-lcn into dev
ujued Feb 20, 2019
4179579
config
ujued Feb 20, 2019
5a22bb7
ribbon
ujued Feb 20, 2019
a2e7258
test
ujued Feb 20, 2019
811e3f0
fixed tracing bug.
ujued Feb 21, 2019
8f39cc4
增强用户事务控制
ujued Feb 21, 2019
5c27b2d
fixed tracing bug.
ujued Feb 21, 2019
775a791
fixed tracing bug.
ujued Feb 21, 2019
e282d85
en_US
ujued Feb 21, 2019
1e45824
en_US
ujued Feb 21, 2019
758e007
en_US
ujued Feb 21, 2019
76a5cba
issues template.
ujued Feb 21, 2019
c1aae3a
id, notify group, rpc
ujued Feb 22, 2019
a4339e2
notify group, tx state
ujued Feb 22, 2019
ad0d3ed
5.0.2
xlorne Feb 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug Report
about: Report a issue to TX-LCN, please use this template.


---

- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.

### 1. Bug Description


### 2. Environment:
- JDK version:
- OS:
- TX-LCN version:
- Others:

### 3. Exception Stacktrace

```
Paste your Exception Stacktrace here!
```

### 4. Tour Idea


16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature Request
about: Suggest an idea for TX-LCN

---

## Why you need it?
Is your feature request related to a problem? Please describe in details


## How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.


## Other related information
Add any other context or screenshots about the feature request here.
59 changes: 16 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,19 @@
# tx-lcn分布式事务框架 (5.0.1.RELEASE)
# Distributed Transaction Framework - LCN (5.0.2.RELEASE)

[![Maven](https://img.shields.io/badge/endpoint.svg?url=https://bbs.txlcn.org/maven-central)](https://bbs.txlcn.org/maven-list)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/codingapi/tx-lcn.svg)](https://gitter.im/codingapi/tx-lcn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![BBS](https://bbs.txlcn.org/style/Archlinux/txlcn-bbs.svg)](https://bbs.txlcn.org)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE)


## 项目介绍

5.0完全拥抱springboot体系,基于JDK1.8,不仅仅支持LCN事务模式,同时引入了TCC,TXC模式,把分布式事务协调的模式抽象出来,让各种模式可以嵌套使用。

事务模式说明:TCC是用户自己实现提交回滚业务,LCN是框架代理JDBC Connection实现提交回滚业务, TXC是框架分析业务SQL提前提交,在需要回滚时生成逆向回滚。

TCC忽略不说。LCN与TXC两种框架实现的事务模式到底那个更优越呢?

理论上,在并发量大,资源相对紧张时,TXC要优于LCN,但从目前测试上来说,结果却非如此,LCN还是稍优于TXC。同时TXC还限制了业务SQL形式,未做到完全逆向
后续版本将会着重优化TXC,包括性能上和SQL的完全逆向上。


版本较4.x主要特点:
1. 基于springboot 研发
2. 抽离LCN封装业务,提出业务接口层与通讯层,可支持自定义分布式事务模式与通讯模式。
3. 支持LCN TXC TCC 三种事务模式,且可混合支持。
4. 性能较优秀,去掉了线程等待机制,提高吞吐量。



## 模块划分

1. txlcn-tc:*TXLCN分布式事务客户端*
2. txlcn-common:*公共模块*
3. txlcn-logger:*日志模块。(默认提供日志持久化到MySQL的支持)*
4. txlcn-tm:*TXLCN事务管理器*
5. txlcn-txmsg:*事务消息扩展接口*
6. txlcn-txmsg-netty:*事务消息接口的Netty实现*
7. txlcn-tracing:*分布式事务追踪工具*

## 官网文档

官网文档 见docs分支

https://txlcn.org


技术交流群:554855843(已满) 970071379(未满)

## Modules
1. txlcn-tc: *Distributed Transaction Client*
2. txlcn-common: *Commons*
3. txlcn-logger: *Provide persistent logs to MySQL*
4. txlcn-tm: *Distributed Transaction Manager*
5. txlcn-txmsg: *Distributed Transaction Message Extensions API*
6. txlcn-txmsg-netty: *Distributed Transaction Message Extensions Implementation*
7. txlcn-tracing: *Distributed Transaction Tracing*

## The Authority
Website: [https://txlcn.org](https://txlcn.org/en-us/)
Statistics: [Leave your company messages](https://github.com/codingapi/tx-lcn/issues/7)
QQ:554855843 (Hot) 970071379(Normal)
46 changes: 46 additions & 0 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# TX-LCN分布式事务框架 (5.0.2.RELEASE)

[![Maven](https://img.shields.io/badge/endpoint.svg?url=https://bbs.txlcn.org/maven-central)](https://bbs.txlcn.org/maven-list)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/codingapi/tx-lcn.svg)](https://gitter.im/codingapi/tx-lcn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)


## 项目介绍

5.0完全拥抱springboot体系,基于JDK1.8,不仅仅支持LCN事务模式,同时引入了TCC,TXC模式,把分布式事务协调的模式抽象出来,让各种模式可以嵌套使用。

事务模式说明:TCC是用户自己实现提交回滚业务,LCN是框架代理JDBC Connection实现提交回滚业务, TXC是框架分析业务SQL提前提交,在需要回滚时生成逆向回滚。

TCC忽略不说。LCN与TXC两种框架实现的事务模式到底那个更优越呢?

理论上,在并发量大,资源相对紧张时,TXC要优于LCN,但从目前测试上来说,结果却非如此,LCN还是稍优于TXC。同时TXC还限制了业务SQL形式,未做到完全逆向
后续版本将会着重优化TXC,包括性能上和SQL的完全逆向上。


版本较4.x主要特点:
1. 基于SpringBoot研发
2. 抽离LCN封装业务,提出业务接口层与通讯层,可支持自定义分布式事务模式与通讯模式。
3. 支持LCN TXC TCC 三种事务模式,且可混合支持。
4. 性能较优秀,去掉了线程等待机制,提高吞吐量。



## 模块划分

1. txlcn-tc:*TXLCN分布式事务客户端*
2. txlcn-common:*公共模块*
3. txlcn-logger:*日志模块。(默认提供日志持久化到MySQL的支持)*
4. txlcn-tm:*TXLCN事务管理器*
5. txlcn-txmsg:*事务消息扩展接口*
6. txlcn-txmsg-netty:*事务消息接口的Netty实现*
7. txlcn-tracing:*分布式事务追踪工具*

## 官网文档

官网文档 见docs分支

https://txlcn.org


技术交流群:554855843(已满) 970071379(未满)

44 changes: 17 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.codingapi.txlcn</groupId>
<artifactId>tx-lcn</artifactId>
<version>5.0.1.RELEASE</version>
<version>5.0.2.RELEASE</version>
<packaging>pom</packaging>


Expand Down Expand Up @@ -43,24 +43,24 @@
<maven.javadoc.plugin>2.10.3</maven.javadoc.plugin>
<maven.gpg.plugin>1.6</maven.gpg.plugin>

<codingapi.txlcn.version>5.0.1.RELEASE</codingapi.txlcn.version>
<codingapi.txlcn.version>5.0.2.RELEASE</codingapi.txlcn.version>

<txlcn-org.projectlombok.version>1.18.0</txlcn-org.projectlombok.version>
<txlcn-spring-cloud.version>Finchley.SR2</txlcn-spring-cloud.version>
<txlcn-io.netty.version>4.1.31.Final</txlcn-io.netty.version>
<txlcn-com.alibaba.fastjson.version>1.2.34</txlcn-com.alibaba.fastjson.version>
<txlcn-guava.version>19.0</txlcn-guava.version>
<txlcn-hessian.version>4.0.38</txlcn-hessian.version>
<txlcn-protostuff.version>1.1.3</txlcn-protostuff.version>
<txlcn-protostuff.version>1.6.0</txlcn-protostuff.version>
<txlcn-kryo.version>4.0.0</txlcn-kryo.version>

<txlcn-com.lmax.disruptor.version>3.4.2</txlcn-com.lmax.disruptor.version>
<txlcn-commons-dbutils.version>1.7</txlcn-commons-dbutils.version>
<txlcn-com.github.jsqlparser.version>1.3</txlcn-com.github.jsqlparser.version>
<txlcn-com.h2database.version>1.4.197</txlcn-com.h2database.version>
<txlcn-hikari-cp.version>3.1.0</txlcn-hikari-cp.version>
<txlcn-com.github.pagehelper.version>1.2.10</txlcn-com.github.pagehelper.version>
<txlcn-org.mybatis.spring.boot.version>1.3.2</txlcn-org.mybatis.spring.boot.version>


<txlcn-com.alibaba.dubbo.verion>2.6.5</txlcn-com.alibaba.dubbo.verion>
<txlcn-com.netflix.feign.core.verison>8.18.0</txlcn-com.netflix.feign.core.verison>
<txlcn-com.netflix.ribbon.loadbalancer.version>2.3.0</txlcn-com.netflix.ribbon.loadbalancer.version>
Expand Down Expand Up @@ -112,15 +112,16 @@
</dependency>

<dependency>
<groupId>com.dyuproject.protostuff</groupId>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-core</artifactId>
</dependency>

<dependency>
<groupId>com.dyuproject.protostuff</groupId>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-runtime</artifactId>
</dependency>


<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-shaded</artifactId>
Expand All @@ -138,12 +139,6 @@
<dependencyManagement>
<dependencies>

<dependency>
<groupId>com.codingapi.txlcn</groupId>
<artifactId>txlcn-tc</artifactId>
<version>${codingapi.txlcn.version}</version>
</dependency>

<dependency>
<groupId>com.codingapi.txlcn</groupId>
<artifactId>txlcn-txmsg-netty</artifactId>
Expand Down Expand Up @@ -174,18 +169,6 @@
<version>${codingapi.txlcn.version}</version>
</dependency>

<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${txlcn-com.github.pagehelper.version}</version>
</dependency>

<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${txlcn-org.mybatis.spring.boot.version}</version>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -235,13 +218,13 @@
</dependency>

<dependency>
<groupId>com.dyuproject.protostuff</groupId>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-core</artifactId>
<version>${txlcn-protostuff.version}</version>
</dependency>

<dependency>
<groupId>com.dyuproject.protostuff</groupId>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-runtime</artifactId>
<version>${txlcn-protostuff.version}</version>
</dependency>
Expand Down Expand Up @@ -282,6 +265,13 @@
<version>${txlcn-org.springframework.cloud.commons.version}</version>
</dependency>

<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.5.18</version>
</dependency>


</dependencies>
</dependencyManagement>

Expand Down
2 changes: 1 addition & 1 deletion run.txmanager.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off

start java -jar -Xms256m -Xmx512m txlcn-tm/target/txlcn-tm-5.0.1.RELEASE.jar
start java -jar -Xms256m -Xmx512m txlcn-tm/target/txlcn-tm-5.0.2.RELEASE.jar

64 changes: 64 additions & 0 deletions tm.docker.build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
### 构建镜像到本地
```
# 当前路径 tx-lcn/txlcn-tm
mvn clean package -DskipTests docker:build
```

#### 运行说明
- 可以不用构建,在有docker环境的机器上直接运行下面命令

1 、 命令行传参数运行

```
docker run -p 7970:7970 -p 8070:8070 --restart always --name tm -e spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx_manager -e spring.datasource.username=root -e spring.datasource.password=root -e spring.redis.host=127.0.0.1 -e spring.redis.port=6379 -e spring.redis.password= -e tx-lcn.manager.admin-key=123456 -d codingapi/txlcn-tm
```
- 说明
- -p 端口映射 宿主机器端口:容器内端口
- --name : 容器别名
- --restart always : 容器伴随docker服务启动(如果docker是开机启动,那么这个容器就是开机启动的)
- -d : 放入后台运行
- -e 相当于 java -jar tm.jar 后面的参数,
- spring.datasource.url 这个配置里面如果有特殊符号 命令行不支持,建议使用第二种方式

2 、 增加外部配置文件运行. 需要在宿主机器上有文件 /opt/data/lcntm/application-dev.properties
```
spring.application.name=tx-manager
server.port=7970
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx-manager?characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=root
#mybatis.configuration.map-underscore-to-camel-case=true
#mybatis.configuration.use-generated-keys=true
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=none
#tx-lcn.logger.enabled=true
# TxManager Host Ip
tx-lcn.manager.host=127.0.0.1
# TxClient连接请求端口
tx-lcn.manager.port=8070
tx-lcn.manager.admin-key=123456

# 心跳检测时间(ms)
#tx-lcn.manager.heart-time=15000
# 分布式事务执行总时间
#tx-lcn.manager.dtx-time=30000
#参数延迟删除时间单位ms
#tx-lcn.message.netty.attr-delay-time=10000
#tx-lcn.manager.concurrent-level=128
# 开启日志
#tx-lcn.logger.enabled=true
#logging.level.com.codingapi=debug
#redisIp
spring.redis.host=127.0.0.1
#redis\u7AEF\u53E3
spring.redis.port=6379
#redis\u5BC6\u7801
#spring.redis.password=
```
执行命令
```
docker run -p 7970:7970 -p 8070:8070 --restart always --name tm -v /opt/data/lcntm:/opt/data/lcntm -e spring.profiles.active=dev -e spring.config.additional-location=/opt/data/lcntm/application-dev.properties -d codingapi/txlcn.tm
```
- 说明
- -v : 文件挂载
2 changes: 1 addition & 1 deletion txlcn-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tx-lcn</artifactId>
<groupId>com.codingapi.txlcn</groupId>
<version>5.0.1.RELEASE</version>
<version>5.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
*/
package com.codingapi.txlcn.common.exception;

import java.io.IOException;

/**
* @author lorne 2018/12/2
*
*/
public class SerializerException extends Exception {
public class SerializerException extends IOException {


public SerializerException() {
Expand All @@ -38,9 +40,7 @@ public SerializerException(Throwable cause) {
super(cause);
}

protected SerializerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}



}
Loading