public static async Task <RabbitMQDelivery> Request(this IRabbitMQChannel channel, IMessageContent content, string exchange = null, string routingKey = null)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            var model = new RequestReplyModel(content);

            await channel.Publish(model, routingKey, exchange);

            return(await model.Context.Task);
        }
Exemple #2
0
 public static Task Publish <TMessage>(this IRabbitMQChannel channel, TMessage message, string routingKey = null, string exchange = null)
 => channel.Publish(message, routingKey, exchange);