static void ApplyCustomizationToOutgoingNativeMessage(IOutgoingTransportOperation transportOperation, ServiceBusMessage message, TransportTransaction transportTransaction) { if (!transportOperation.Properties.TryGetValue(NativeMessageCustomizationBehavior.CustomizationKey, out var key)) { return; } var messageCustomizer = transportTransaction.Get <NativeMessageCustomizer>(); if (!messageCustomizer.Customizations.TryGetValue(key, out var action)) { Log.Warn( $"Message {transportOperation.Message.MessageId} was configured with a native message customization but the customization was not found in {nameof(NativeMessageCustomizer)}"); return; } action(message); }