title: How to pause and resume RMQ consumer in Java
body: <p>RMQConsumer in my code is a spring bean which is initialised at the time of Spring container initialisation.
  It starts listening to RMQ messages on the queue as soon that Spring bean is ready irrespective of the whole Spring container is ready or not.
  I want to start the consumption of messages only when the kubernates pod status is 1/1. As during rolling deployment, old pods are not terminated unless new pods are 1/1 status, which causes almost double the amount of pod count and spikes the consumption rate which is not desired in my case of some reasons.</p>
  <p>What i tried
  I removed the channel.basicConsume method of RMq api which was executed at Bean postConstruct. And added the code in a Rest controller method under endpoint ‘’’/postStart’’’ which i configured in kubernates deployment file under lifecycle hook of postStart, which doesnt seems to work. The hook is called before spring application even prints its first log(verified with time stamps).</p>