Return addresses - rebus-org/Rebus GitHub Wiki
In order to implement the request/reply pattern, a return address is needed. Therefore, Rebus will automatically set the input queue address of your endpoint (unless it is a one-way client) as the rbs2-return-address
header, allowing the recipient to go
await bus.Reply(someReply);
in a message handler, thus returning a reply back to the sender.
This mechanism can be used to cause the reply to be sent somewhere else too, since the rbs2-return-address
header will only be set if it is not already present. So if you go
var headers = new Dictionary<string, string> {
{ Headers.ReturnAddress, "anotherQueue@somewhereElse" }
};
await bus.Send(someRequest, headers);
the recipient will send its reply to anotherQueue@somewhereElse
.