Brighter icon indicating copy to clipboard operation
Brighter copied to clipboard

feat: allow extend/customize the find topic publication

Open lillo42 opened this issue 8 months ago • 1 comments

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:

  • IAmAPublicationFinder interface: Enables users to define custom logic for resolving publications based on request types or topics, replacing the default behavior.
  • RequestContext.Topic Property: Extends RequestContext to 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 avatar May 06 '25 12:05 lillo42

@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.

iancooper avatar May 30 '25 07:05 iancooper