-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure that DeadLetter
s published by DistributedPubSubMediator
contain full context of topic
#6209
Make sure that DeadLetter
s published by DistributedPubSubMediator
contain full context of topic
#6209
Conversation
… contain full context of topic This is a usability improvement aimed at making sure we contain the full context of what topic we were trying to publish to or which `Put`-ed actor we were trying to publish to when there are no subscribers available on the local node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Described my changes
@@ -500,7 +500,7 @@ private void IgnoreOrSendToDeadLetters(object message) | |||
Context.System.DeadLetters.Tell(new DeadLetter(message, Sender, Context.Self)); | |||
} | |||
|
|||
private void PublishMessage(string path, object message, bool allButSelf = false) | |||
private void PublishMessage(string path, IWrappedMessage publish, bool allButSelf = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than send just the object Message
to these methods, send the full IWrappedMessage
payload which we'll pass directly to the IgnoreOrSendToDeadLetters
method - as that wrapper message includes all of the useful debugging context a developer might need.
{ | ||
var prefix = path + "/"; | ||
var lastKey = path + "0"; // '0' is the next char of '/' | ||
|
||
var groups = ExtractGroups(prefix, lastKey).GroupBy(kv => kv.Key).ToList(); | ||
var wrappedMessage = new SendToOneSubscriber(message); | ||
var wrappedMessage = new SendToOneSubscriber(publish.Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forward only the payload to the subscriber still, preserving the same behavior as before.
|
||
if (groups.Count == 0) | ||
{ | ||
IgnoreOrSendToDeadLetters(message); | ||
IgnoreOrSendToDeadLetters(publish); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send the full, debuggable payload to DeadLetter
s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… contain full context of topic (akkadotnet#6209) This is a usability improvement aimed at making sure we contain the full context of what topic we were trying to publish to or which `Put`-ed actor we were trying to publish to when there are no subscribers available on the local node. (cherry picked from commit 9f84438)
… contain full context of topic (#6209) (#6212) This is a usability improvement aimed at making sure we contain the full context of what topic we were trying to publish to or which `Put`-ed actor we were trying to publish to when there are no subscribers available on the local node. (cherry picked from commit 9f84438) Co-authored-by: Aaron Stannard <aaron@petabridge.com>
Changes
This is a usability improvement aimed at making sure we contain the full context of what topic we were trying to publish to or which
Put
-ed actor we were trying to publish to when there are no subscribers available on the local node.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):