Volver al ranking

liuyangming/ByteTCC

Javabytesoft.org

ByteTCC is a distributed transaction manager based on the TCC(Try/Confirm/Cancel) mechanism. It’s compatible with the JTA specification. User guide: https://github.com/liuyangming/ByteTCC/wiki

tccspring-clouddubbodistributed-transactionjtatransaction
Crecimiento de estrellas
Estrellas
2.9k
Forks
902
Crecimiento semanal
Issues
99
1k2k
mar 2016ago 2019feb 2023jul 2026
ArtefactosMavengit clone https://github.com/liuyangming/ByteTCC.git
README

 ByteTCC is an implementation of Distributed Transaction Manager, based on Try-Confirm-Cancel (TCC) mechanism.

ByteTCC is comptible with JTA and could be seamlessly integrated with Spring and other Java containers.

1. Quick Start

1.1 Add maven depenency

1.1.1. Spring Cloud
<dependency>
	<groupId>org.bytesoft</groupId>
	<artifactId>bytetcc-supports-springcloud</artifactId>
	<version>0.5.12</version>
</dependency>
1.1.2. dubbo
<dependency>
	<groupId>org.bytesoft</groupId>
	<artifactId>bytetcc-supports-dubbo</artifactId>
	<version>0.5.12</version>
</dependency>

1.2 Compose a business service

@Service("accountService")
@Compensable(
  interfaceClass = IAccountService.class 
, confirmableKey = "accountServiceConfirm"
, cancellableKey = "accountServiceCancel"
)
public class AccountServiceImpl implements IAccountService {

	@Resource(name = "jdbcTemplate")
	private JdbcTemplate jdbcTemplate;

	@Transactional
	public void increaseAmount(String accountId, double amount) throws ServiceException {
	    this.jdbcTemplate.update("update tb_account set frozen = frozen + ? where acct_id = ?", amount, acctId);
	}

}

1.3 Compose a confirm service

@Service("accountServiceConfirm")
public class AccountServiceConfirm implements IAccountService {

	@Resource(name = "jdbcTemplate")
	private JdbcTemplate jdbcTemplate;

	@Transactional
	public void increaseAmount(String accountId, double amount) throws ServiceException {
	    this.jdbcTemplate.update("update tb_account set amount = amount + ?, frozen = frozen - ? where acct_id = ?", amount, amount, acctId);
	}

}

1.4 Compose a cancel service

@Service("accountServiceCancel")
public class AccountServiceCancel implements IAccountService {

	@Resource(name = "jdbcTemplate")
	private JdbcTemplate jdbcTemplate;

	@Transactional
	public void increaseAmount(String accountId, double amount) throws ServiceException {
	    this.jdbcTemplate.update("update tb_account set frozen = frozen - ? where acct_id = ?", amount, acctId);
	}

}

2. Documentation & Samples

3. Features

  • support declarative transaction management
  • support normal transaction, TCC transaction, compensating service transaction
  • support distributed transaction scenarios. e.g. multi-datasource, cross-applications and cross-servers transaction
  • support long live transaction
  • support Dubbo framework
  • support Spring Cloud
  • provide solutions for service idempotence in framework layer

4. Contact Me

If you have any questions or comments regarding this project, please feel free to contact me at:

  1. send mail to bytefox#126.com OR
  2. add Tecent QQ group 537445956/606453172/383515467

We will review all the suggestions and implement good ones in future release.

Repositorios relacionados
apache/incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

JavaMavenApache License 2.0tccsaga
seata.apache.org
26k8.9k
dtm-labs/dtm

A distributed transaction framework, supports workflow, saga, tcc, xa, 2-phase message, outbox patterns, supports many languages.

GoGo ModulesBSD 3-Clause "New" or "Revised" Licensesagaxa
d.dtm.pub
10.9k999
dromara/hmily

Distributed transaction solutions

JavaMavenApache License 2.0tccspringcloud
dromara.org
4.2k1.4k
TinyCC/tinycc

Unofficial mirror of mob development branch

CGNU Lesser General Public License v2.1compilerc
repo.or.cz/w/tinycc.git
3k550
prontera/spring-cloud-rest-tcc

以Spring Cloud Netflix作为服务治理基础, 展示基于tcc思想所实现的分布式事务解决方案

JavaMavenspring-cloudspring-boot
2.5k1.2k
QNJR-GROUP/EasyTransaction

A distribute transaction solution(分布式事务) unified the usage of TCC , SAGA ,FMT (seata/fescar AutoCompensation), reliable message, compensate and so on;

JavaMavenApache License 2.0transactiontcc
2.4k796
ryanmjacobs/c

Compile and execute C "scripts" in one go!

ShellMIT Licenseclitcc
2.2k185
dromara/raincat

强一致分布式事务框架

JavaMavenGNU Lesser General Public License v3.0spring-cloudspi
dromara.org
1.9k650
DosX-dev/obfus.h

Macro-header for compile-time C obfuscation (tcc, win x86/x64)

CMIT Licensecconfuse
dosx.su
1.7k149
apache/incubator-seata-go

Go Implementation For Seata

GoGo ModulesApache License 2.0attcc
seata.apache.org
1.7k348
anael-seghezzi/CToy

Interactive C live coding environment

C++Otherlivecodingtcc
1.4k75
alekmaul/pvsneslib

PVSnesLib : A small, open and free development kit for the Nintendo SNES

CMIT Licensenintendo-snessdk
1.1k92