/// <summary>
 ///   Declare x-dead-letter-exchange argument. When message is dead, send to x-dead-letter-exchange.
 ///   Declare x-dead-letter-routing-key argument. When message is dead, send to x-dead-letter-exchange with routing key.
 /// </summary>
 public static IRabbitMQQueueBuilder <TPayload> DeadLetterTo <TPayload>(
     this IRabbitMQQueueBuilder <TPayload> builder,
     IRabbitMQExchangeBuilder exchange,
     string routingKey = null)
 {
     return(builder.DeadLetterTo((IRabbitMQExchangeBuilderCore)exchange, routingKey));
 }
        /// <summary>
        ///   Declare x-dead-letter-exchange argument. When message is dead, send to x-dead-letter-exchange.
        ///   Declare x-dead-letter-routing-key argument. When message is dead, send to x-dead-letter-exchange with routing key.
        /// </summary>
        public static IRabbitMQQueueBuilder <TPayload> DeadLetterTo <TPayload>(
            this IRabbitMQQueueBuilder <TPayload> builder,
            IRabbitMQExchangeBuilder exchange,
            IRabbitMQQueueBuilder <TPayload> queue)
        {
            var binding = queue.Declaration
                          .BindingDeclarations
                          .FirstOrDefault(b => b.ExchangeDeclaration == exchange.ExchangeDeclaration);

            return(builder.DeadLetterTo(exchange, binding?.RoutingKey ?? queue.Declaration.Name));
        }