Build every outgoing RabbitMQ message in one module: one pure build call per operation owns ids, routing, properties, envelope, retry, fault and reply, and faults and replies get the base properties - #433
Merged
Conversation
…all per operation owns ids, routing, properties, envelope, retry, fault and reply, and faults and replies get the base properties
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
Every message the RabbitMQ transport writes to the broker is now built in one module. Before,
RabbitMqWireMessageBuilderhad four small helpers (one took 7 parameters for 2 lines), so the publisher, the send endpoint and the requester each repeated the same sequence by hand, the routing-key rule was written twice, and the consumer worker built its retry, fault and reply messages with their own, slightly different properties.RabbitMqOutgoingMessages(new, internal) has one pure build call per operation —Publish,Send,Request,Retry,Fault,Reply— and does no I/O. It owns:Type,MessageId,ContentType,Timestamp, a copy of the headers) and the properties per operation (ReplyTo, the AMQP correlation id, persistence, TTL);ReplyTogets no reply).RabbitMqOutgoingMessage(exchange, routing key, mandatory flag, properties, body) is what every producer publishes;RabbitMqProducedMessageadds the resolved ids and starts the producer activity for publish, send and request.Result, the worker publishes through its channel gate).IInternalPublishertakes the built message.RabbitMqWireMessageBuilderis deleted.ContentTypeand aMessageIdof their own; replies gainMessageId(their envelope's) andTimestamp. Nothing in this repository reads these on faults or replies. The faultType(Fault<…>) and the persistence rules do not change. The messaging docs state the rule.Publishfailure result.No public API change.
Verification
dotnet build Vulthil.SharedKernel.slnx: 0 warnings, 0 errors.Vulthil.Messaging.RabbitMq.Testshas 139 tests. The newRabbitMqOutgoingMessagesTestshas 19 cases: 16 new, and the 3 fault-route tests moved there from the worker tests. Each new test compares one row — route, mandatory flag and every property — with the shape its operation must have, without mocks, and checks the body.Vulthil.IntegrationTests(Docker, including the real-broker delayed-retry and consumer-pause tests): 70/70 on net10.0 and net9.0.MessagingIntegrationTests(real producer and consumer services, including request/reply): 13/13 on net10.0.ContentType: 1 test fails;MessageId: 1 test fails;Backport to v1.0: no