Adds Endpoint Configuration via Hanlders to Mocha#9482
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a transport-level “claim” API (transport.Handler<T>() / transport.Consumer<T>()) that auto-creates a convention-named receive endpoint per claimed handler/consumer and allows fluent endpoint configuration via returned configurators, then materializes those claims during transport configuration creation (RabbitMQ/Postgres/InMemory).
Changes:
- Add handler/consumer claim APIs to
IMessagingTransportDescriptor+ per-transport descriptor interfaces, backed byHandlerClaimand fluent configurators. - Add runtime-type binding for receive endpoints (
Handler(Type)), enabling claim materialization without generics. - Materialize claims in RabbitMQ/Postgres/InMemory
CreateConfiguration()by creating endpoints, binding identities, and applying captured endpoint configuration actions.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mocha/src/Mocha/Transport/MessagingTransportDescriptor.cs | Adds claim APIs and stores claims for transport-specific materialization. |
| src/Mocha/src/Mocha/Transport/IHandlerConfigurator.cs | New public fluent configurator interface for handler claims. |
| src/Mocha/src/Mocha/Transport/IConsumerConfigurator.cs | New public fluent configurator interface for consumer claims. |
| src/Mocha/src/Mocha/Transport/HandlerConfigurator.cs | Internal implementation capturing endpoint configuration actions onto claims. |
| src/Mocha/src/Mocha/Transport/HandlerClaim.cs | Internal claim record storing claimed type + optional endpoint configuration delegate. |
| src/Mocha/src/Mocha/Transport/ConsumerConfigurator.cs | Internal implementation capturing endpoint configuration actions onto claims. |
| src/Mocha/src/Mocha/Endpoints/Descriptors/ReceiveEndpointDescriptor.cs | Adds runtime-type handler binding method on endpoint descriptors. |
| src/Mocha/src/Mocha/Endpoints/Descriptors/IReceiveEndpointDescriptor.cs | Adds Handler(Type) overload to the receive endpoint descriptor contract. |
| src/Mocha/src/Mocha/Assembly.cs | Adds InternalsVisibleTo for Mocha.Transport.InMemory. |
| src/Mocha/src/Mocha.Transport.RabbitMQ/Descriptors/RabbitMQReceiveEndpointDescriptor.cs | Adds Handler(Type) fluent overload for RabbitMQ endpoint descriptor. |
| src/Mocha/src/Mocha.Transport.RabbitMQ/Descriptors/RabbitMQMessagingTransportDescriptor.cs | Adds transport-level claim APIs + materializes claims into endpoints during configuration creation. |
| src/Mocha/src/Mocha.Transport.RabbitMQ/Descriptors/IRabbitMQReceiveEndpointDescriptor.cs | Adds Handler(Type) to the RabbitMQ endpoint descriptor interface. |
| src/Mocha/src/Mocha.Transport.RabbitMQ/Descriptors/IRabbitMQMessagingTransportDescriptor.cs | Exposes transport-level claim APIs with RabbitMQ-specific endpoint descriptor type. |
| src/Mocha/src/Mocha.Transport.Postgres/Descriptors/PostgresReceiveEndpointDescriptor.cs | Adds Handler(Type) fluent overload for Postgres endpoint descriptor. |
| src/Mocha/src/Mocha.Transport.Postgres/Descriptors/PostgresMessagingTransportDescriptor.cs | Adds transport-level claim APIs + materializes claims into endpoints during configuration creation. |
| src/Mocha/src/Mocha.Transport.Postgres/Descriptors/IPostgresReceiveEndpointDescriptor.cs | Adds Handler(Type) to the Postgres endpoint descriptor interface. |
| src/Mocha/src/Mocha.Transport.Postgres/Descriptors/IPostgresMessagingTransportDescriptor.cs | Exposes transport-level claim APIs with Postgres-specific endpoint descriptor type. |
| src/Mocha/src/Mocha.Transport.InMemory/Topology/Descriptors/InMemoryTopicDescriptor.cs | Adjusts Configuration accessibility to support internal usage patterns. |
| src/Mocha/src/Mocha.Transport.InMemory/Topology/Descriptors/InMemoryQueueDescriptor.cs | Adjusts Configuration accessibility to support internal usage patterns. |
| src/Mocha/src/Mocha.Transport.InMemory/Topology/Descriptors/InMemoryBindingDescriptor.cs | Adjusts Configuration accessibility to support internal usage patterns. |
| src/Mocha/src/Mocha.Transport.InMemory/Descriptors/InMemoryReceiveEndpointDescriptor.cs | Adds Handler(Type) fluent overload for InMemory endpoint descriptor. |
| src/Mocha/src/Mocha.Transport.InMemory/Descriptors/InMemoryMessagingTransportDescriptor.cs | Adds transport-level claim APIs + materializes claims into endpoints during configuration creation. |
| src/Mocha/src/Mocha.Transport.InMemory/Descriptors/InMemoryDispatchEndpointDescriptor.cs | Adjusts Configuration accessibility to support internal usage patterns. |
| src/Mocha/src/Mocha.Transport.InMemory/Descriptors/IInMemoryReceiveEndpointDescriptor.cs | Adds Handler(Type) to the InMemory endpoint descriptor interface. |
| src/Mocha/src/Mocha.Transport.InMemory/Descriptors/IInMemoryMessagingTransportDescriptor.cs | Exposes transport-level claim APIs with InMemory-specific endpoint descriptor type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9482 +/- ##
==========================================
- Coverage 74.16% 0 -74.17%
==========================================
Files 2677 0 -2677
Lines 140790 0 -140790
Branches 16371 0 -16371
==========================================
- Hits 104421 0 -104421
+ Misses 30774 0 -30774
+ Partials 5595 0 -5595
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.