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
Do not auto discover generic event handlers #17465
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #17465 +/- ##
==========================================
- Coverage 53.34% 53.29% -0.05%
==========================================
Files 3024 3024
Lines 94357 94362 +5
==========================================
- Hits 50334 50292 -42
- Misses 44023 44070 +47 ☔ View full report in Codecov by Sentry. |
Is there any actual reason to use such a class?
|
Yes, we have an options to set which events should be handled by this handler. |
framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/EventBusTestModule.cs
Show resolved
Hide resolved
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is still unresolved. Waiting for the staff's response. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@maliming 非要在单元测试里复现的话,那需要ABP先提供一个KafkaEventBus的单元测试 |
Description
Adding a GenericTypeDefinition (a generic type without arguments) to the
AbpLocalEventBusOptions.Handlers
orAbpDistributedEventBusOptions.Handlers
makes no sense.It cannot be determined which event should be subscribed.
And it makes KafkaDistributedEventBus broken:
Checklist
How to test it?
Take the
MyGenericDistributedEventHandler
class to your tests with Kafka Event Bus, then register it to your service collection likeEventBusTestModule
.It would be broken without this patch.