public async Task Defer(TimeSpan delay, Dictionary <string, string> optionalAdditionalHeaders = null) { var transportMessage = GetCloneOfCurrentTransportMessage(optionalAdditionalHeaders); var timeoutManagerAddress = _rebusBus.GetTimeoutManagerAddress(); transportMessage.SetDeferHeaders(RebusTime.Now + delay, _rebusBus._transport.Address); await _rebusBus.SendTransportMessage(timeoutManagerAddress, transportMessage); }
public Task Defer(string destinationAddress, TimeSpan delay, object explicitlyRoutedMessage, Dictionary <string, string> optionalHeaders = null) { var logicalMessage = CreateMessage(explicitlyRoutedMessage, Operation.Defer, optionalHeaders); logicalMessage.SetDeferHeaders(_rebusTime.Now + delay, destinationAddress); var timeoutManagerAddress = _rebusBus.GetTimeoutManagerAddress(); return(_rebusBus.InnerSend(new[] { timeoutManagerAddress }, logicalMessage)); }