-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Integrate RocketMQ into Seata #3974
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
22f069c
feature-透过Spring的后置代理器实现了RocketMQ Bean的拦截,并返回了静态代理类
GasolLY 9250bf4
Merge branch 'develop' into feature-tcc-rocketmq
slievrly 65b1d0d
feature-初步实现TCC集成RocketMQ的目标
GasolLY b0503b4
初步完成tcc 集成 rocketmq
GasolLY 44ada44
reformat code
GasolLY 1a48e4a
Merge branch 'develop' into feature-tcc-rocketmq
wangliang181230 d9b01f4
添加了RocketMQAspect的自动配置,并对代码进行了优化
GasolLY 077f473
将rocketmq自动配置类从seata-spring模块移动到seata-spring-boot-starter模块
GasolLY f18251e
Merge branch 'develop' into feature-tcc-rocketmq
wangliang181230 4c04890
代码优化
GasolLY 9475bc3
Merge remote-tracking branch 'gitlab/feature-tcc-rocketmq' into featu…
GasolLY a2a0643
merge修复
GasolLY e1f1f8a
bugfix
GasolLY 2f878ae
bugfix
GasolLY 618bac2
修改seata.rocketmq-enabled默认值为false
GasolLY 0ecce21
Merge remote-tracking branch 'origin/feature-tcc-rocketmq' into featu…
GasolLY 69909f2
Merge remote-tracking branch 'origin/develop' into feature-tcc-rocketmq
GasolLY 7528426
使用静态代理重构代码
GasolLY 62cfc33
Merge branch 'develop' into feature-tcc-rocketmq
funky-eyes 038e7ea
bug fix
GasolLY cc4b655
Merge branch '2.x' into feature-tcc-rocketmq
funky-eyes df29716
opt
funky-eyes 74aaf43
opt
funky-eyes c22aea7
opt
funky-eyes 6a85838
opt
funky-eyes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,43 +72,21 @@ public class GlobalTransactionalInterceptorHandler extends AbstractProxyInvocati | |
|
||
private final TransactionalTemplate transactionalTemplate = new TransactionalTemplate(); | ||
private final GlobalLockTemplate globalLockTemplate = new GlobalLockTemplate(); | ||
|
||
private Set<String> methodsToProxy; | ||
private static int degradeCheckAllowTimes; | ||
|
||
private volatile boolean disable; | ||
private static final AtomicBoolean ATOMIC_DEGRADE_CHECK = new AtomicBoolean(false); | ||
private static volatile Integer degradeNum = 0; | ||
private static volatile Integer reachNum = 0; | ||
private static int degradeCheckAllowTimes; | ||
protected AspectTransactional aspectTransactional; | ||
private static int degradeCheckPeriod; | ||
|
||
private static int defaultGlobalTransactionTimeout = 0; | ||
|
||
private final FailureHandler failureHandler; | ||
protected AspectTransactional aspectTransactional; | ||
private Set<String> methodsToProxy; | ||
|
||
private static final EventBus EVENT_BUS = new GuavaEventBus("degradeCheckEventBus", true); | ||
private static volatile ScheduledThreadPoolExecutor executor; | ||
|
||
private void initDefaultGlobalTransactionTimeout() { | ||
if (GlobalTransactionalInterceptorHandler.defaultGlobalTransactionTimeout <= 0) { | ||
int defaultGlobalTransactionTimeout; | ||
try { | ||
defaultGlobalTransactionTimeout = ConfigurationFactory.getInstance().getInt( | ||
ConfigurationKeys.DEFAULT_GLOBAL_TRANSACTION_TIMEOUT, DEFAULT_GLOBAL_TRANSACTION_TIMEOUT); | ||
} catch (Exception e) { | ||
LOGGER.error("Illegal global transaction timeout value: " + e.getMessage()); | ||
defaultGlobalTransactionTimeout = DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; | ||
} | ||
if (defaultGlobalTransactionTimeout <= 0) { | ||
LOGGER.warn("Global transaction timeout value '{}' is illegal, and has been reset to the default value '{}'", | ||
defaultGlobalTransactionTimeout, DEFAULT_GLOBAL_TRANSACTION_TIMEOUT); | ||
defaultGlobalTransactionTimeout = DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; | ||
} | ||
GlobalTransactionalInterceptorHandler.defaultGlobalTransactionTimeout = defaultGlobalTransactionTimeout; | ||
} | ||
} | ||
|
||
public GlobalTransactionalInterceptorHandler(FailureHandler failureHandler, Set<String> methodsToProxy) { | ||
this.failureHandler = failureHandler == null ? FailureHandlerHolder.getFailureHandler() : failureHandler; | ||
this.methodsToProxy = methodsToProxy; | ||
|
@@ -134,6 +112,25 @@ public GlobalTransactionalInterceptorHandler(FailureHandler failureHandler, Set< | |
this.aspectTransactional = aspectTransactional; | ||
} | ||
|
||
private void initDefaultGlobalTransactionTimeout() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个没必要挪位置吧,看不出来改动了什么 |
||
if (GlobalTransactionalInterceptorHandler.defaultGlobalTransactionTimeout <= 0) { | ||
int defaultGlobalTransactionTimeout; | ||
try { | ||
defaultGlobalTransactionTimeout = ConfigurationFactory.getInstance().getInt( | ||
ConfigurationKeys.DEFAULT_GLOBAL_TRANSACTION_TIMEOUT, DEFAULT_GLOBAL_TRANSACTION_TIMEOUT); | ||
} catch (Exception e) { | ||
LOGGER.error("Illegal global transaction timeout value: " + e.getMessage()); | ||
defaultGlobalTransactionTimeout = DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; | ||
} | ||
if (defaultGlobalTransactionTimeout <= 0) { | ||
LOGGER.warn("Global transaction timeout value '{}' is illegal, and has been reset to the default value '{}'", | ||
defaultGlobalTransactionTimeout, DEFAULT_GLOBAL_TRANSACTION_TIMEOUT); | ||
defaultGlobalTransactionTimeout = DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; | ||
} | ||
GlobalTransactionalInterceptorHandler.defaultGlobalTransactionTimeout = defaultGlobalTransactionTimeout; | ||
} | ||
} | ||
|
||
@Override | ||
public Set<String> getMethodsToProxy() { | ||
return methodsToProxy; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么夹杂这么多tccfence的改动,而且看起来好像都是调了位置而已