title: How to set Spring Boot RabbitMQ Heartbeat on Cloud Foundry?
body: <p>I have an application running on Cloud Foundry with Spring Boot (1.5.12) and spring-boot-starter-amqp</p>
  
  <p>Based on the previous SO answer to <a href="https://stackoverflow.com/questions/42118570/set-heartbeat-property-on-rabbitmq-autoconfig-connectionfactory-bean">set heartbeat property on rabbitmq autoconfig connectionfactory bean</a>, I tried setting the heart beat property as follows.</p>
  
  <pre><code>cf set-env app spring.rabbitmq.requested-heartbeat 30
  cf restage app
  </code></pre>
  
  <p>However, when viewed through the Rabbit Management Console, the connection still indicates the heart beat is at the default of 60s.</p>
  
  <p>I took a heap dump using the actuator endpoints, and took a look at the <code>connectionFactory</code> that seemed to have been auto-reconfigured by spring-cloud-spring-service-connector. It seems to have the default 60 seconds, and ignores the 30 seconds requested.</p>
  
  <p>Is there another environment property that should be used to configure the heartbeat value ? If not, I suspect we will wire the <code>CachingConnectionFactory</code> and modify it in there.</p>