Closed rsivanov closed 4 years ago
Quick question though: What happens to additional replies, when they're received?
Are they silently ignored? Because I think they should be.....
Quick question though: What happens to additional replies, when they're received?
Are they silently ignored? Because I think they should be.....
Yes, they should be silently ignored. await PublishRequest_log.Warn("Received
message with message ID {messageId}, which was determined to be a reply to be handled as an inline request-reply reply (because of the {prefix} prefix), BUT the dictionary of task completion sources did NOT contain an entry for that ID",
inReplyToMessageId, SpecialMessageIdPrefix);
And this warning tells us, that our implementation of subscribers is incorrect
And this warning tells us, that our implementation of subscribers is incorrect
but.... with the SignalR backplane implementation, wouldn't all subscribers reply back?
And this warning tells us, that our implementation of subscribers is incorrect
but.... with the SignalR backplane implementation, wouldn't all subscribers reply back?
No, just the one, that owns the connection. The others just ignore the message:
public Task Handle(AddToGroup<THub> message)
{
var connection = _hubLifetimeManager.Connections[message.ConnectionId];
if (connection == null)
return Task.CompletedTask;
_hubLifetimeManager.AddGroupLocal(connection, message.GroupName);
return _bus.Reply(new Ack<THub>(serverName: _hubLifetimeManager.ServerName));
}
ah, ok!
I'll push a new version right away
it's out in Rebus.Async 7.1.0, which is on NuGet.org now 🙂
Added PublishRequest which does the same thing that SendRequest, but uses IBus.Publish instead of IBus.Send.
A scenario for which it is useful - we have multiple subscribers for Rebus.SignalR backplane listening for AddToGroup message for a particular connection. Only one host (where that connection lives) should reply to the message, but we don't know which one before the publishing of the message. So, we need to make a broadcast call (IBus.Publish) to all subscribed hosts.
Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.