Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RSB 3.0 Customize DeliverBy
public class CustomizeOutgoingMessages : ICustomizeOutgoingMessages
{
public void Customize(OutgoingMessageInformation messageInformation)
{
// Messages is an object[] containing the batch of messages being sent.
// This will only have one message unless you send multiple
// messages at once with using IServiceBus.
var message = messageInformation.Messages[0] as SomeTemporaryMessage;
if (message != null)
{
messageInformation.DeliverBy = DateTime.Now.AddSeconds(message.ValidForSeconds);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.