Skip to content
Mogens Heller Grabe edited this page Dec 14, 2016 · 2 revisions

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.

Clone this wiki locally