Giter Site home page Giter Site logo

wpstarnice / happylifeplat-transaction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dromara/raincat

0.0 1.0 0.0 864 KB

分布式事务框架(二阶段提交+本地补偿方案)

Home Page: https://yu199195.github.io/categories/happylifeplat-transaction/

License: Apache License 2.0

Java 92.74% HTML 0.38% JavaScript 0.91% Vue 5.61% CSS 0.35%

happylifeplat-transaction's Introduction

happylifeplat-transaction

碧桂园旺生活平台强一致性分布式事务,是基于二阶段提交+本地事务补偿机制来实现。原理介绍

基于java语言来开发(JDK1.8),支持dubbo,motan,springcloud进行分布式事务。

因为文件名太长,大家在拉取代码的时候执git命令:git config --global core.longpaths true

Features

  • 框架特性

    • 支持dubbo,motan,springcloud,等rpc框架进行分布式事务。

    • 事务发起者,参与者与协调者底层基于netty长连接通信,稳定高效。

    • 协调者采用eureka做注册中心,支持集群模式。

    • 采用Aspect AOP 切面**与Spring无缝集成。

    • 配置简单,集成简单,源码简洁,稳定性高,已在生产环境使用。

    • 内置经典的分布式事务场景demo工程,并有swagger-ui可视化界面可以快速体验。

  • 事务角色

    • 事务发起者(可理解为消费者 如:dubbo的消费者,springcloud的调用方),发起分布式事务

    • 事务参与者(可理解为提供者 如:dubbo的提供者,springcloud的rest服务提供者),参与事务发起者的事务

    • 事务协调者(tx-manager),协调分布式事务的提交,回滚等。

  • 技术方案

    • 协调者(tx-manager)采用eureka作为注册中心,集群配置,达到服务的高可用,采用redis集群来分布式存储事务数据, springboot 提供rest服务,采用netty与参与者,发起者进行长连接通信。

    • 发起者与协调者,采用Aspect AOP 切面**,SPI,多线程,异步回调,线程池,netty通信等技术。

  • SPI扩展

    • 本地事务恢复,支持redis,mogondb,zookeeper,file,mysql等关系型数据库
    • 本地事务序列化保存,支持java,hessian,kryo,protostuff
    • netty通信序列化方式,支持 hessian,kryo,protostuff

Design

Configuration

Prerequisite

  • JDK 1.8+

  • Maven 3.2.x

  • Git

  • RPC framework dubbo or motan or springcloud。

Quick Start

  • Clone & Build

    > git clone https://github.com/yu199195/happylifeplat-transaction.git
    
    > cd happylifeplat-transaction
    
    > mvn -DskipTests clean install -U
    

User Guide

FAQ

  • 为什么我下载的代码后,用idea打开没有相应的get set 方法呢?

    答:因为框架使用了Lombok包,它是在编译的时期,自动生成get set方法,并不影响运行,如果觉得提示错误难受,请自行下载lombok包插件,lombok官网
  • 为什么我运行demo工程,找不到applicationContent.xml呢?

    答:请设置项目的资源文件夹。

Support

如有任何问题欢迎加入QQ群:162614487 进行讨论

Contribution

happylifeplat-transaction's People

Contributors

yu199195 avatar

Watchers

coco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.