Brighter
Brighter copied to clipboard
feat: allow extend/customize the find topic publication
This pull request introduces an extensibility point to customize how Brighter locates publications for message routing, particularly addressing multi-tenant scenarios where applications share the same request types but require tenant-specific queues. Key additions include:
IAmAPublicationFinderinterface: Enables users to define custom logic for resolving publications based on request types or topics, replacing the default behavior.RequestContext.TopicProperty: ExtendsRequestContextto allow senders to explicitly specify the topic a message should route to, providing granular control over message distribution.PublicationTopicAttribute: Adds an attribute-based mechanism to associate a specific topic with a request type, simplifying configurations where multiple request types map to the same topic.Publication<T>Class: Streamlines publication setup for request types by encapsulating boilerplate configuration, improving readability and reducing errors.
These changes enhance flexibility for advanced use cases (e.g., multi-tenancy) while maintaining backward compatibility.
@lillo42 Could you add an ADR for this one, so that we can understand the various use cases and how the design supports them. It's a little hard to review without that, I think.