Skip to content

[Mocha] Configure receive resilience on RabbitMQ queues - #10507

Merged
PascalSenn merged 1 commit into
mainfrom
pse/mocha-configurable-rabbitmq-queue
Oct 9, 2026
Merged

PascalSenn merged 1 commit into
mainfrom
pse/mocha-configurable-rabbitmq-queue

Conversation

@PascalSenn

Copy link
Copy Markdown
Member

Adds IConfigurable and moves AddResilience, AddCircuitBreaker and
AddConcurrencyLimiter onto IConfigurable.
Receive middleware providers apply the callback immediately. The
RabbitMQ Queue(...) descriptor records the callbacks and replays them
onto the queue's receive endpoint.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:17
@PascalSenn
PascalSenn added this pull request to stack #10511 October 8, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Queue-configured immediate retry policies are not honored by the consumer retry middleware.

1 open finding
What changed in this PR

Enables RabbitMQ queue descriptors to configure receive resilience through callbacks applied to their receive endpoints.

Changes:

  • Adds IConfigurable<T> and adapts resilience extensions.
  • Records queue callbacks and replays them onto receive endpoints.
  • Tests feature configuration and exception-policy composition.
File Description
src/​Mocha/​test/​Mocha.Transport.RabbitMQ.Tests/​Descriptors/​RabbitMQUnifiedQueueTests.cs Tests queue resilience configuration.
src/​Mocha/​src/​Mocha/​Transport/​MessagingTransportDescriptor.cs Applies receive-provider callbacks immediately.
src/​Mocha/​src/​Mocha/​Middlewares/​Receive/​ConcurrencyLimiter/​ConcurrencyLimiterConfigurationExtensions.cs Uses configurable targets for concurrency limits.
src/​Mocha/​src/​Mocha/​Middlewares/​Receive/​CircuitBreaker/​CircuitBreakerConfigurationExtensions.cs Uses configurable targets for circuit breakers.
src/​Mocha/​src/​Mocha/​Middlewares/​Consume/​Retry/​ResilienceConfigurationExtensions.cs Uses configurable targets for resilience policies.
src/​Mocha/​src/​Mocha/​Descriptors/​IConfigurable.cs Defines the callback contract.
src/​Mocha/​src/​Mocha.Transport.RabbitMQ/​Descriptors/​RabbitMQQueueDescriptor.cs Records receive-endpoint callbacks.
src/​Mocha/​src/​Mocha.Transport.RabbitMQ/​Descriptors/​RabbitMQMessagingTransportDescriptor.cs Replays queue callbacks onto endpoints.
src/​Mocha/​src/​Mocha.Transport.RabbitMQ/​Descriptors/​IRabbitMQQueueDescriptor.cs Exposes receive configuration support.
src/​Mocha/​src/​Mocha.Transport.RabbitMQ/​Configurations/​RabbitMQQueueDescriptorConfiguration.cs Stores ordered callbacks.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

82.1% of changed lines covered (23/28)

File Covered Changed Patch %
…/Consume/Retry/ResilienceConfigurationExtensions.cs 6 11 54.5% 🔴
…/Configurations/RabbitMQQueueDescriptorConfiguration.cs 1 1 100.0% 🟢
…/Descriptors/RabbitMQMessagingTransportDescriptor.cs 4 4 100.0% 🟢
…/Descriptors/RabbitMQQueueDescriptor.cs 4 4 100.0% 🟢
…/CircuitBreaker/CircuitBreakerConfigurationExtensions.cs 2 2 100.0% 🟢
…/ConcurrencyLimiterConfigurationExtensions.cs 2 2 100.0% 🟢
…/Mocha/src/Mocha/Transport/MessagingTransportDescriptor.cs 4 4 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "fe61552fb55eff4d05e7a69d8e1cfc6d61de99ad",
  "files": [
    { "path": "src/Mocha/src/Mocha/Middlewares/Consume/Retry/ResilienceConfigurationExtensions.cs", "ranges": [[78, 82]] }
  ]
}

Project coverage: 58.6% (314230/536423 lines)

@PascalSenn
PascalSenn force-pushed the pse/mocha-configurable-rabbitmq-queue branch from 50ff4f1 to fac31dd Compare October 8, 2026 20:15
Adds IConfigurable<T> and moves AddResilience, AddCircuitBreaker and
AddConcurrencyLimiter onto IConfigurable<IReceiveMiddlewareProvider>.
Receive middleware providers apply the callback immediately. The
RabbitMQ Queue(...) descriptor records the callbacks and replays them
onto the queue's receive endpoint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants