-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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: support configuring scan target for GlobalTransactionScanner #2852
Conversation
…alTransactionScanner
Codecov Report
@@ Coverage Diff @@
## develop #2852 +/- ##
=============================================
- Coverage 50.30% 50.04% -0.27%
+ Complexity 3069 3068 -1
=============================================
Files 600 603 +3
Lines 19514 19616 +102
Branches 2408 2428 +20
=============================================
Hits 9817 9817
- Misses 8714 8812 +98
- Partials 983 987 +4
|
…TransactionScanner.addScannerExcluders()
…化,导致配置信息无法正常获取并设置到其中。
spring/src/main/java/io/seata/spring/annotation/scannerexcluders/ScopeBeansScannerExcluder.java
Outdated
Show resolved
Hide resolved
spring/src/main/java/io/seata/spring/annotation/scannerexcluders/ScopeBeansScannerExcluder.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## develop #2852 +/- ##
=============================================
- Coverage 50.87% 50.62% -0.25%
- Complexity 3280 3283 +3
=============================================
Files 612 615 +3
Lines 20113 20222 +109
Branches 2519 2539 +20
=============================================
+ Hits 10233 10238 +5
- Misses 8853 8953 +100
- Partials 1027 1031 +4
|
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.
LGTM
# Conflicts: # seata-spring-boot-starter/src/main/java/io/seata/spring/boot/autoconfigure/SeataAutoConfiguration.java
…scanner # Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # spring/src/main/java/io/seata/spring/annotation/GlobalTransactionScanner.java
Codecov Report
@@ Coverage Diff @@
## develop #2852 +/- ##
=============================================
- Coverage 51.56% 51.21% -0.35%
- Complexity 3564 3565 +1
=============================================
Files 641 644 +3
Lines 21624 21732 +108
Branches 2710 2699 -11
=============================================
- Hits 11150 11130 -20
- Misses 9342 9442 +100
- Partials 1132 1160 +28
|
Ⅰ. Describe what this PR did
feature: support custom scan target for GlobalTransactionScanner
配置方式1:配置只想扫描的package或需要排除的beanName:
配置方式2:实现扫描校验器接口,判断是否需要扫描:
扫描校验器接口:
io.seata.spring.annotation.ScannerChecker
添加校验器的三种方式:
ScannerChecker
实现类的spring bean即可,seata会自动读取所有实现了该接口的bean./META-INF/service/io.seata.spring.annotation.ScannerChecker
文件中。GlobalTransactionScanner.addScannerCheckers(checkers)
静态方法添加。(注:上面两种方式最终也是由seata自行调用此方法添加的)seata提供的ScannerChecker
io.seata.spring.annotation.scannercheckers.ScopeBeansScannerChecker
:目前可以排除 添加了以下四种
@Scope
的bean :request
,session
,job
,step
.可自行调用
ScopeBeansScannerChecker.addExcludeScopes(scopeNames)
添加更多想要排除的scope类型。io.seata.spring.annotation.scannercheckers.ConfigBeansScannerChecker
:beanName为
*AutoConfiguration
和*Properties
的bean排除掉。Ⅱ. Does this pull request fix one issue?
fixes #2815
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews