title: Rabbitmq ERROR CachingConnectionFactory:1302 - Channel shutdown: channel error;
body: <p>I am getting this error</p>
  
  <p>ERROR CachingConnectionFactory:1302 - Channel shutdown: channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'xyz.xyz.dlq' in vhost 'qa40': received the value '10000' of type 'signedint' but current is none, class-id=50, method-id=10)</p>
  
  <p>Where my config file has this </p>
  
  <pre><code>spring.cloud.stream.bindings.xyz.destination=xyz
  spring.cloud.stream.bindings.xyz.group=xyz_group
  spring.cloud.stream.bindings.xyz.consumer.max-attempts=1
  spring.cloud.stream.rabbit.bindings.xyz.consumer.republish-to-dlq=true
  spring.cloud.stream.rabbit.bindings.xyz.consumer.requeue-rejected=false
  spring.cloud.stream.rabbit.bindings.xyz.consumer.auto-bind-dlq=true
  spring.cloud.stream.rabbit.bindings.xyz.consumer.dlq-ttl=10000
  spring.cloud.stream.rabbit.bindings.xyz.consumer.dlq-dead-letter-exchange=
  </code></pre>
  
  <p>I am using delay exchange i.e</p>
  
  <pre><code>public class xyzDlqConsumer extends RerouteDLQMessages {
  
      private final static String QUEUE_NAME = xyz.xyz_group;
      private final static String DLQ = QUEUE_NAME + ".dlq";
  
      public String getOriginalQueue() {
          return QUEUE_NAME;
      }
  
      @RabbitListener(queues = DLQ)
      private void callRepublish(Message failedMessage) {
          rePublish(failedMessage);
      }
  }
  
  public abstract class RerouteDLQMessages {
  
      private static final String X_RETRIES_HEADER = "x-retries";
      private static final String DELAY_EXCHANGE = "dlqReRouter";
      @Value("${RETRIES_COUNT}") . //3
      private Integer retriesCount;
      @Value("${DELAY_TIME}") //10000
      private Integer messageDelay;
      @Autowired
      private RabbitTemplate rabbitTemplate;
  
  
      protected abstract String getOriginalQueue();
  
      public void rePublish(Message failedMessage) {
  
          Map&lt;String, Object&gt; headers = failedMessage.getMessageProperties().getHeaders();
          Integer retriesHeader = (Integer) headers.get(X_RETRIES_HEADER);
          if (retriesHeader == null) {
              retriesHeader = Integer.valueOf(0);
          }
  
          if (retriesHeader &lt; retriesCount) {
              headers.put(X_RETRIES_HEADER, retriesHeader + 1);
              headers.put("x-delay", messageDelay * retriesHeader);
              this.rabbitTemplate.send(DELAY_EXCHANGE, getOriginalQueue(), failedMessage);
          } else {
  
              //do whatever you want after three attempts
          }
      }
  
      @Bean
      public DirectExchange delayExchange() {
          DirectExchange exchange = new DirectExchange(DELAY_EXCHANGE);
          exchange.setDelayed(true);
          return exchange;
      }
  
      @Bean
      public Binding bindOriginalToDelay() {
          return BindingBuilder.bind(new Queue(getOriginalQueue())).to(delayExchange()).with(getOriginalQueue());
      }
  }
  </code></pre>