From 4fc5f702fe97e4119b0262251ac3dbfe23edc576 Mon Sep 17 00:00:00 2001 From: xudeyou Date: Thu, 22 Nov 2018 22:25:23 +0800 Subject: [PATCH 1/2] bugfix: consistantGuardian daemon not init --- .../recovery/ConsistentGuardianDaemonConfiguration.java | 2 +- .../com/yiqiniu/easytrans/EasyTransCoreConfiguration.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/easytrans-core/src/main/java/com/yiqiniu/easytrans/recovery/ConsistentGuardianDaemonConfiguration.java b/easytrans-core/src/main/java/com/yiqiniu/easytrans/recovery/ConsistentGuardianDaemonConfiguration.java index 1940e9e..d11a567 100644 --- a/easytrans-core/src/main/java/com/yiqiniu/easytrans/recovery/ConsistentGuardianDaemonConfiguration.java +++ b/easytrans-core/src/main/java/com/yiqiniu/easytrans/recovery/ConsistentGuardianDaemonConfiguration.java @@ -21,7 +21,7 @@ public class ConsistentGuardianDaemonConfiguration { private String applicationName; @Bean - @ConditionalOnProperty("easytrans.recovery.enabled") + @ConditionalOnProperty(name="easytrans.recovery.enabled",matchIfMissing = true) public ConsistentGuardianDaemon consistentGuardianDaemon(ConsistentGuardianDaemonProperties properties,TransactionLogReader logReader, ConsistentGuardian guardian, EasyTransMasterSelector master){ return new ConsistentGuardianDaemon(logReader, guardian, master, properties.getExecuteInterval(), properties.getPageSize(), properties.getDelay()); diff --git a/easytrans-starter/src/main/java/com/yiqiniu/easytrans/EasyTransCoreConfiguration.java b/easytrans-starter/src/main/java/com/yiqiniu/easytrans/EasyTransCoreConfiguration.java index b0e4bb3..1ad82fc 100644 --- a/easytrans-starter/src/main/java/com/yiqiniu/easytrans/EasyTransCoreConfiguration.java +++ b/easytrans-starter/src/main/java/com/yiqiniu/easytrans/EasyTransCoreConfiguration.java @@ -17,6 +17,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Lazy; import org.springframework.transaction.PlatformTransactionManager; @@ -329,9 +330,8 @@ public static class EnableDefaultRpcImpl { public static class EnableDefaultMasterImpl { } - @Bean - public ConsistentGuardianDaemonConfiguration consistentGuardianDaemonConfiguration() { - return new ConsistentGuardianDaemonConfiguration(); + @Import(ConsistentGuardianDaemonConfiguration.class) + public static class EnableConsistentGuardianDaemon { } @Bean From 903c35f9bd4e2aa75f6425684f479be736ca03df Mon Sep 17 00:00:00 2001 From: xudeyou Date: Thu, 22 Nov 2018 22:58:07 +0800 Subject: [PATCH 2/2] change version to 1.1.2 --- easytrans-demo/interface-call/pom.xml | 2 +- easytrans-demo/rpc-dubbo/pom.xml | 2 +- easytrans-demo/sagatcc/pom.xml | 2 +- easytrans-demo/tcc-and-msg/pom.xml | 2 +- easytrans-demo/tcc-only/pom.xml | 2 +- pom.xml | 2 +- readme-en.md | 2 +- readme.md | 4 +++- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/easytrans-demo/interface-call/pom.xml b/easytrans-demo/interface-call/pom.xml index 179645b..b764af7 100644 --- a/easytrans-demo/interface-call/pom.xml +++ b/easytrans-demo/interface-call/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/easytrans-demo/rpc-dubbo/pom.xml b/easytrans-demo/rpc-dubbo/pom.xml index 053c60a..a1cb6cd 100644 --- a/easytrans-demo/rpc-dubbo/pom.xml +++ b/easytrans-demo/rpc-dubbo/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/easytrans-demo/sagatcc/pom.xml b/easytrans-demo/sagatcc/pom.xml index 1a5a735..7bf4262 100644 --- a/easytrans-demo/sagatcc/pom.xml +++ b/easytrans-demo/sagatcc/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/easytrans-demo/tcc-and-msg/pom.xml b/easytrans-demo/tcc-and-msg/pom.xml index 0a8b036..fe1ad10 100644 --- a/easytrans-demo/tcc-and-msg/pom.xml +++ b/easytrans-demo/tcc-and-msg/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/easytrans-demo/tcc-only/pom.xml b/easytrans-demo/tcc-only/pom.xml index 78d4db2..a5d6f53 100644 --- a/easytrans-demo/tcc-only/pom.xml +++ b/easytrans-demo/tcc-only/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/pom.xml b/pom.xml index b7a5f06..de68b2f 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ UTF-8 UTF-8 1.8 - 1.1.1 + 1.1.2 diff --git a/readme-en.md b/readme-en.md index 5025d10..48a4985 100644 --- a/readme-en.md +++ b/readme-en.md @@ -104,7 +104,7 @@ Business code can introduce EasyTransaction by maven com.yiqiniu.easytrans easytrans-starter - 1.1.1 + 1.1.2 This Starter contains several default implement, included: RDBS based distributed transaction log,Netflix-ribbon based http RPC implement,KAFKA based queue,if you want to replace it ,just exclude it. diff --git a/readme.md b/readme.md index 7b8c0c8..788cb58 100644 --- a/readme.md +++ b/readme.md @@ -55,6 +55,8 @@ * 本框架实现的SAGA并非传统的SAGA,可以将其类比为异步TCC,与传统SAGA的区别可以类比 传统补偿及TCC的关系 * 还有就是本框架使用RPC而非队列实现SAGA,具体原因可以在SAGA-TCC这个DEMO里查看 +关于如何选择分布式事务形态,更详细的可参考:https://mp.weixin.qq.com/s/Vwh4RuwEocsMpOFyvmFJfw + ### 框架对应实现及基本原理 框架实现了上述所有事务场景的解决方案,并提供了统一易用的接口。以下介绍基本实现原理 @@ -90,7 +92,7 @@ com.yiqiniu.easytrans easytrans-starter - 1.1.1 + 1.1.2 Starter里包含了若干默认的组件实现:基于mysql的分布式事务日志存储,基于ribbon-rest的RPC实现,基于KAFKA的消息队列,若不需要或者要替换,可以EXCLUDE掉