Repository navigation
feat: send a distributed message's result back to the sender on a reply routing key - #727
Merged
Merged
Conversation
…the sender's reply-to channel
…e what a reply carries
… prove a reply-to flow on every flow suite
…reply on the routing slip
…iver without tracing
…and the retried request replies once
…us channel, and send the source-less request through an application gateway
…ery other DistributedBus method
1 task done
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.
Why is this change proposed?
Why
A service that sends a message through the Distributed Bus can now get the receiving handler's result back on a routing key of its own choice.
Before this change,
DistributedBus::sendMessage()could only send a message one way. If the sender needed the result, the receiving service had to know about the sender and send a second message back itself. That puts the sender's routing inside the receiver.Before / after
Before
sequenceDiagram participant User as user_service participant Ticket as ticket_service User->>Ticket: sendMessage('ticket.create') Note over Ticket: handler result is discardedAfter
sequenceDiagram participant User as user_service participant Ticket as ticket_service User->>Ticket: sendMessage('ticket.create', replyRoutingKey: 'ticket.created') Ticket-->>User: handler result, through ticket_service's Service Map Note over User: 'ticket.created' handler runsExample
In
user_service, which sends the request and handles the reply:In
ticket_service, which handles the request and returns the result:Description of Changes
DistributedServiceMap. A reply is refused with a message that names how to fix it in three cases: the request names no source service, no Service Map maps the sender, or two Service Maps map the sender to different channels. Start reading atDistributedReplyRouter.nullresult, and a reply is never answered again.sendMessage()'stargetChannelNameis nowroutingKey, the name the other fourDistributedBusmethods use. Positional calls are unchanged. A namedtargetChannelName:argument fails, andupgrade-2.0.mdrecords the rename.#[Distributed]#[InternalHandler]is drawn with its reply edge. The reply flow is part of the shared flow catalogue, so tracing, OpenTelemetry, flow tracking and the graph are all checked against it.The Distributed Bus with a Service Map is Enterprise, so replies are Enterprise too.
Pull Request Contribution Terms