Created
October 24, 2012 23:33
-
-
Save RyanHauert/3949608 to your computer and use it in GitHub Desktop.
RSB 3.0 Customize DeliverBy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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