Particular / NServiceBus

Build, version, and monitor better microservices with the most powerful service platform for .NET
https://particular.net/nservicebus/
Other
2.08k stars 647 forks source link

Using metadata reader to discover forwarded type destination #7085

Closed danielmarbach closed 3 months ago

danielmarbach commented 3 months ago

@bording and I discussed an alternative to https://github.com/Particular/NServiceBus/pull/7081 that discovers forwarded types and includes those in scanning. Unfortunately it is not possible to reflect the type forwarding attributes because they get erased. You can only access the information by using the metadata reader.

The upside of this approach is that it is more future proof when we add more type forwarding attributes. The downside is that it requires slightly more "heavy" lifting during assembly scanner initialization.

Base PR

image

This PR

image

The frozen set creation takes the majority of the time

image

what if we'd change it to a HashSet

image

danielmarbach commented 3 months ago

We ported over the metadata reading part into a test in https://github.com/Particular/NServiceBus/pull/7081