private void ApplyAnyOutgoingProperties(TMessage message, BrokeredMessage brokeredMessage) { IOutgoingMessageProperties outgoingProperties = _messageOutgoingPropertiesTable.GetOutgoingPropertiesForMessage(message); // Check if there were even any outgoing properties set for this message if (outgoingProperties != null) { brokeredMessage.ScheduledEnqueueTimeUtc = outgoingProperties.ScheduledEnqueueTimeUtc; brokeredMessage.TimeToLive = outgoingProperties.TimeToLive; // Remove the properties for the message from the table now that we've mapped them as they'll have no further use beyond this point _messageOutgoingPropertiesTable.RemoveOutgoingPropertiesForMessage(message); } }