title: Rabbit-Mq not routing to dead letter queue after being rejected
body: <p>I'm currently playing around with Rabbit-Mq, and am trying to implement a "dead-letter" queue, a queue for failed messages. I've been reading the rabbit documentation: <a href="https://www.rabbitmq.com/dlx.html" rel="noreferrer">https://www.rabbitmq.com/dlx.html</a>.</p>
  
  <p>and have come up with this example:</p>
  
  <pre><code>internal class Program
  {
      private const string WorkerExchange = "work.exchange";
      private const string RetryExchange = "retry.exchange";
      public const string WorkerQueue = "work.queue";
      private const string RetryQueue = "retry.queue";
  
      static void Main(string[] args)
      {
          var factory = new ConnectionFactory { HostName = "localhost" };
  
          using (var connection = factory.CreateConnection())
          {
              using (var channel = connection.CreateModel())
              {
                  channel.ExchangeDeclare(WorkerExchange, "direct");
                  channel.QueueDeclare
                  (
                      WorkerQueue, true, false, false,
                      new Dictionary&lt;string, object&gt;
                      {
                          {"x-dead-letter-exchange", RetryExchange},
  
                          // I have tried with and without this next key
                          {"x-dead-letter-routing-key", RetryQueue}
                      }
                  );
                  channel.QueueBind(WorkerQueue, WorkerExchange, string.Empty, null);
  
                  channel.ExchangeDeclare(RetryExchange, "direct");
                  channel.QueueDeclare
                  (
                      RetryQueue, true, false, false,
                      new Dictionary&lt;string, object&gt; {
                          { "x-dead-letter-exchange", WorkerExchange },
                          { "x-message-ttl", 30000 },
                      }
                  );
                  channel.QueueBind(RetryQueue, RetryExchange, string.Empty, null);
  
                  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);
  
                      Thread.Sleep(1000);
                      Console.WriteLine("Rejected message");
  
                      // also tried  channel.BasicNack(ea.DeliveryTag, false, false);
                      channel.BasicReject(ea.DeliveryTag, false);
                  };
  
                  channel.BasicConsume(WorkerQueue, false, consumer);
  
                  Console.WriteLine(" Press [enter] to exit.");
                  Console.ReadLine();
              }
          }
      }
  }
  </code></pre>
  
  <p>Image of queue when publishing to worker queue:
  <a href="https://i.stack.imgur.com/K6xAq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/K6xAq.png" alt="rabbit-mq worker queue stats"></a></p>
  
  <p>Image of the retry queue:
  <a href="https://i.stack.imgur.com/rVuBt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rVuBt.png" alt="rabbit-mq retry stats"></a></p>
  
  <p>I feel as though I'm missing some small details but can't seem to find what they are.</p>
  
  <p>Thanks in advance</p>