Task PublishMessage(MulticastTransportOperation transportOperation, ConfirmsAwareChannel channel, RabbitMQMessagePriority priority) { var message = transportOperation.Message; var properties = channel.CreateBasicProperties(); properties.Fill(message, transportOperation.DeliveryConstraints, out _); if (priority != null) { properties.Priority = priority.Priority; } return(channel.PublishMessage(transportOperation.MessageType, message, properties)); }
Task SendMessage(UnicastTransportOperation transportOperation, ConfirmsAwareChannel channel, RabbitMQMessagePriority priority) { var message = transportOperation.Message; var properties = channel.CreateBasicProperties(); properties.Fill(message, transportOperation.DeliveryConstraints, out var destination); if (priority != null) { properties.Priority = priority.Priority; } return(channel.SendMessage(destination ?? transportOperation.Destination, message, properties)); }