public override Task ConsumeAsync(ConsumedMessage <Request> message) { return(Task.Factory .StartNew(() => { Console.WriteLine("[{0}]received '{1}' by '{2}' with correlation id {3}", message.ConsumerTag, message.Headers.MessageId, GetType().Name, message.Headers.CorrelationId); var exchange = _broker.DeclareDirectExchange(message.Headers .ReplyConfiguration .ExchangeName); var queue = _broker.DeclareQueue(message.Headers .ReplyConfiguration .RoutingKey); _broker.DeclareExchangeBinding(exchange, queue, message.Headers.ReplyConfiguration.RoutingKey); var outboundMessage = new OutboundMessage <Response>(new Response { BarBar = message.Content.Bar * 2 }); outboundMessage.SetCorrelationId(message.Headers.CorrelationId); _connection.PublishAsync(outboundMessage, exchange, message.Headers.ReplyConfiguration.RoutingKey); })); }
private static Exchange DeclareExchange(IBroker broker) { return(broker.DeclareDirectExchange("test_benchmarks_exchange")); }
private static Exchange DeclareExchange(IBroker broker) { return broker.DeclareDirectExchange("test_benchmarks_exchange"); }