Skip to content

Instantly share code, notes, and snippets.

@RyanHauert
Created October 24, 2012 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanHauert/3949608 to your computer and use it in GitHub Desktop.
Save RyanHauert/3949608 to your computer and use it in GitHub Desktop.
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