title: Spring Boot rabbit mq spring.rabbitmq.listener.simple.concurrency never works
body: <p>In SpringBoot rabbit mq project,I have the configuration like that.</p>
  
  <pre><code>@EnableRabbit
  @Configuration
  public class MQConfig {
  
  private final String primaryQueueName;
  private final String deadLetterQueueName;
  
  @Autowired
  private ConnectionFactory cachingConnectionFactory;
  
  public MQConfig(  
                   @Value("${primaryQueue.name}")String primaryQueueName,
                   @Value("${deadLetterQueue.name}")String deadLetterQueueName){
  
      this.primaryQueueName=primaryQueueName;
      this.deadLetterQueueName=deadLetterQueueName;
  }
  
  
  @Bean
  public Queue primaryQueue() {
      Map&lt;String, Object&gt; args = new HashMap&lt;String, Object&gt;();
      // The default exchange
      args.put("x-dead-letter-exchange", "");
      // Route to the incoming queue when the TTL occurs
      args.put("x-dead-letter-routing-key", deadLetterQueueName);
      // TTL 500 seconds
      args.put("x-message-ttl", 300000);
      return new Queue(primaryQueueName, false, false, false, args);
  }
  
  @Bean
  public Queue deadLetterQueue() {
      return new Queue(deadLetterQueueName);
  }}
  </code></pre>
  
  <p>And my listener looks like,</p>
  
  <pre><code> @Component
  public class Receiver {
   private static final Logger LOGGER = LoggerFactory.getLogger(Receiver.class);
  
      @Autowired
      private JavaMailSender mailSender;
  
  
  @RabbitListener(queues = "${primaryQueue.name}")
  public void receiveMessage(SimpleMailMessage message){
      LOGGER.info("Sending email message : "+message);
      try {
          mailSender.send(message);
      }catch(Exception e) {
          LOGGER.error("Failed to deliver email",e);
          throw e;
      }
  
  }}
  </code></pre>
  
  <p>So far so good, the messages come to primary queue, the consumer consumes them and they are gone to dead letter queue if for some reason the consumer is not able to consume them in given TTL 300000.</p>
  
  <p>Now, I want to configure the listener even further with spring application.properties, but they have no impact on it at all.
  E.g. I set spring.rabbitmq.listener.simple.concurrency=3, still it creates a single consumer, explicitly setting it in code works however. Nether works other settings,</p>
  
  <pre><code>spring.rabbitmq.listener.simple.acknowledge-mode= # Acknowledge mode of container.
  spring.rabbitmq.listener.simple.auto-startup=true # Start the container automatically on startup.
  spring.rabbitmq.listener.simple.concurrency= # Minimum number of consumers.
  spring.rabbitmq.listener.simple.default-requeue-rejected= # Whether or not to requeue delivery failures; default `true`.
  spring.rabbitmq.listener.simple.idle-event-interval= # How often idle container events should be published in milliseconds.
  spring.rabbitmq.listener.simple.max-concurrency= # Maximum number of consumers.
  spring.rabbitmq.listener.simple.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used).
  spring.rabbitmq.listener.simple.retry.enabled=false # Whether or not publishing retries are enabled.
  spring.rabbitmq.listener.simple.retry.initial-interval=1000 # Interval between the first and second attempt to deliver a message.
  spring.rabbitmq.listener.simple.retry.max-attempts=3 # Maximum number of attempts to deliver a message.
  spring.rabbitmq.listener.simple.retry.max-interval=10000 # Maximum interval between attempts.
  spring.rabbitmq.listener.simple.retry.multiplier=1.0 # A multiplier to apply to the previous delivery retry interval.
  spring.rabbitmq.listener.simple.retry.stateless=true # Whether or not retry is stateless or stateful.
  spring.rabbitmq.listener.simple.transaction-size=  
  </code></pre>
  
  <p><a href="https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html" rel="nofollow noreferrer">https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html</a>
  Any ideas? Am I configuring something incorrectly ? </p>