I need to set a custom return-address as described here https://github.com/rebus-org/Rebus/wiki/Return-addresses but there's no attachheader option anymore.
How do I achieve this in rebus2?
All methods on IBus
that send messages have an optional parameter that accepts a headers dictionary.
Therefore, you can simply
var headers = new Dictionary<string, string> {
{ Headers.ReturnAddress, "wherever" }
};
await bus.Send(yourMessage, headers);
in order to set a custom return address :)