예제 #1
0
        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));
        }
예제 #2
0
        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));
        }