Task SendMessage(UnicastTransportOperation transportOperation, ConfirmsAwareChannel channel)
        {
            var message = transportOperation.Message;

            var properties = channel.CreateBasicProperties();

            properties.Fill(message, transportOperation.DeliveryConstraints, channel.SupportsDelayedDelivery, out var destination);

            return(channel.SendMessage(destination ?? transportOperation.Destination, message, properties));
        }
        Task PublishMessage(MulticastTransportOperation transportOperation, ConfirmsAwareChannel channel)
        {
            var message = transportOperation.Message;

            var properties = channel.CreateBasicProperties();

            properties.Fill(message, transportOperation.DeliveryConstraints, channel.SupportsDelayedDelivery, out _);

            return(channel.PublishMessage(transportOperation.MessageType, message, properties));
        }
        Task PublishMessage(MulticastTransportOperation transportOperation, ConfirmsAwareChannel channel, CancellationToken cancellationToken)
        {
            var message = transportOperation.Message;

            var properties = channel.CreateBasicProperties();

            properties.Fill(message, transportOperation.Properties);

            return(channel.PublishMessage(transportOperation.MessageType, message, properties, cancellationToken));
        }
        Task SendMessage(UnicastTransportOperation transportOperation, ConfirmsAwareChannel channel, CancellationToken cancellationToken)
        {
            var message = transportOperation.Message;

            var properties = channel.CreateBasicProperties();

            properties.Fill(message, transportOperation.Properties);

            return(channel.SendMessage(transportOperation.Destination, message, properties, cancellationToken));
        }
Example #5
0
 public void ReturnPublishChannel(ConfirmsAwareChannel channel)
 {
     if (channel.IsOpen)
     {
         channels.Enqueue(channel);
     }
     else
     {
         channel.Dispose();
     }
 }
        public ConfirmsAwareChannel GetPublishChannel()
        {
            if (!channels.TryDequeue(out var channel) || channel.IsClosed)
            {
                channel?.Dispose();

                channel = new ConfirmsAwareChannel(connection, routingTopology, usePublisherConfirms);
            }

            return(channel);
        }
Example #7
0
        public ConfirmsAwareChannel GetPublishChannel()
        {
            ConfirmsAwareChannel channel;

            if (!channels.TryDequeue(out channel) || channel.IsClosed)
            {
                channel?.Dispose();

                channel = new ConfirmsAwareChannel(connection.Value, routingTopology, usePublisherConfirms, allEndpointsSupportDelayedDelivery);
            }

            return(channel);
        }
Example #8
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));
        }
Example #9
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));
        }