Skip to content

Adds Endpoint Configuration via Hanlders to Mocha#9482

Merged
PascalSenn merged 7 commits intomainfrom
pse/adds-handler-configuration
Mar 29, 2026
Merged

Adds Endpoint Configuration via Hanlders to Mocha#9482
PascalSenn merged 7 commits intomainfrom
pse/adds-handler-configuration

Conversation

@PascalSenn
Copy link
Copy Markdown
Member

@PascalSenn PascalSenn commented Mar 29, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 29, 2026 15:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by HandlerClaim and 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.

Comment thread src/Mocha/src/Mocha/Transport/MessagingTransportDescriptor.cs Outdated
@github-actions github-actions Bot added the 📚 documentation This issue is about working on our documentation. label Mar 29, 2026
@PascalSenn PascalSenn merged commit c25cd32 into main Mar 29, 2026
128 checks passed
@PascalSenn PascalSenn deleted the pse/adds-handler-configuration branch March 29, 2026 22:54
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (6a3b7a3) to head (a6f1777).
⚠️ Report is 1058 commits behind head on main.

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     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants