forked from rebus-org/Rebus
-
Notifications
You must be signed in to change notification settings - Fork 0
Return addresses
Mogens Heller Grabe edited this page Aug 6, 2013
·
1 revision
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 rebus-return-address
header, allowing the recipient to go
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 rebus-return-address
header will only be set if it is not already present. So if you go
bus.AttachHeader(someRequest, Headers.ReturnAddress, "anotherQueue@somewhereElse");
bus.Send(someRequest);
the recipient will send its reply to anotherQueue@somewhereElse
.