RabbitMQ: direct reply-to?
<p>Is there a good example (C#) of how to do the direct reply-to in RabbitMQ? What I want to do is for X Producers to post a message ("I've got some work for somebody") and I want one of X Consumers to pick it up, do the work and send the response back. Not a basic Ack, but some data, the result of the calculation. Of course, the response has to go back to the right producer.</p>

<p>Producer:</p>

<pre><code>    using (var connection = factory.CreateConnection())
    {
        using (var channel = connection.CreateModel())
        {
            channel.QueueDeclare(queue: "hello",
                                 durable: true,
                                 exclusive: false,
                                 autoDelete: false,
                                 arguments: null);

            string message = "Hello World!";
            var body = Encoding.UTF8.GetBytes(message);

            var properties = channel.CreateBasicProperties();
            properties.Persistent = true;

            channel.BasicPublish(exchange: "",
                                 routingKey: "hello",
                                 basicProperties: properties,
                                 body: body);

            Console.WriteLine(" [x] Sent {0}", message);
        }
    }
</code></pre>

<p>Consumer:</p>

<pre><code>    using (var connection = factory.CreateConnection())
    {
        using (var channel = connection.CreateModel())
        {
            channel.QueueDeclare(queue: "hello",
                                 durable: true,
                                 exclusive: false,
                                 autoDelete: false,
                                 arguments: null);

            channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);

            var consumer = new EventingBasicConsumer(channel);

            consumer.Received += (model, ea) =&gt;
            {
                var body = ea.Body;
                var message = Encoding.UTF8.GetString(body);
                Console.WriteLine(" [x] Received {0}", message);
                channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false);
            };

            channel.BasicConsume(queue: "hello",
                                 noAck: false,
                                 consumer: consumer);

            Console.WriteLine(" Press [enter] to exit.");
            Console.ReadLine();
        }
</code></pre>

<p>It's not very clear from the minimal docs on how to set up both sides. I know somebody has to do something with the "amq.rabbitmq.reply-to" queue, but its not clear which side and what they have to do with it.</p>