title: how to set queue/message durability to false in Spring AMQP using annotations?
body: <p>I wrote sample spring amqp producer which is running on RabbitMQ server which sends messages and consuming those messages uisng MessageListener using Spring AMQP. Here, I want to set queue and message durability to false. Could you please any one help me on how to set "durable" flag to false using annotations.</p>
  
  <p>Here is sample code </p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  public class ProducerConfiguration {
  
      protected final String queueName = "hello.queue";
  
      @Bean
      public RabbitTemplate rabbitTemplate() {
          RabbitTemplate template = new RabbitTemplate(connectionFactory());
          template.setRoutingKey(this.queueName);
          template.setQueue(this.queueName);
          return template;
      }
  
      @Bean
      public ConnectionFactory connectionFactory() {
          CachingConnectionFactory connectionFactory = new CachingConnectionFactory("localhost");
          connectionFactory.setUsername("guest");
          connectionFactory.setPassword("guest");
          return connectionFactory;
      }
  }
  
  
  public class Producer {
  
      public static void main(String[] args) throws Exception {
          new Producer().send();
      }
  
      public void send() {
  
          ApplicationContext context = new AnnotationConfigApplicationContext(
                  ProducerConfiguration.class);
          RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
          for (int i = 1; i &lt;= 10; i++) {
              rabbitTemplate.convertAndSend(i);
          }
      }
  
  }
  </code></pre>
  
  <p>Thanks in Advance.</p>