Run deliveries through one core DeliveryDispatcher behind an IDeliveryPort, and move the test harness onto it - #422
Merged
Conversation
…yPort, and move the test harness onto it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds one core delivery-dispatch module to
Vulthil.Messaging.Transportand moves the in-memory test harness onto it.The RabbitMQ transport does not change here. It moves onto the same module in a follow-up PR.
Core module (additive public API)
DeliveryDispatcherruns one delivery through its handlers with these rules:port can redeliver later and no retrying policy is in-memory, the outcome is
RedeliverLaterinstead.Abandon. A consumer's ownOperationCanceledExceptionwhile the token is live is an ordinary failure.IDeliveryPortis the part a transport implements for each delivery: the receive context, the in-process retrywait, the fault route and the reply route.
DeliveryHandlerFactorybuildsDeliveryHandlers forMessageExecutionRegistry<DeliveryHandler>.DeliveryOutcomeandDeliverySettlementtell the transport how to settle.AddMessagingregisters the dispatcher as a singleton.IMessageHandlerFactoryretryPolicydocs are fixed. A null policy means the handler fails for good on itsfirst failure, not "inherit the queue default".
Test harness
InMemoryHandlerFactoryandInMemoryHandlerare deleted. The harness implements the port.Fault<T>is still captured inPublished<Fault<T>>()and still runsHandle<Fault<T>>stubs. It is nolonger delivered to an
IConsumer<Fault<T>>, because the broker never delivers it there either.OperationCanceledExceptionis retried like any failure.OperationCanceledException, and a requestreturns a
Messaging.Request.Cancelledfailure.Docs
Verification
Vulthil.IntegrationTests(Testcontainers, 68 tests)and the Aspire messaging integration tests (net10.0, 13 tests).
DeliveryDispatcherTestsand 9 inHarnessDeliveryTests.dotnet packofVulthil.MessagingandVulthil.Messaging.TestHarnesspasses package validation against the1.2.0 baseline (additive only).
Backport to v1.0: no