title: How to programmatically stop RabbitListener in Micronaut
body: <p>I have a RabbitListener that looks like:</p>
  <pre><code>@RabbitListener
  public class ProductListener {
  
      @Queue(value = &quot;product&quot;, executor = &quot;product-listener&quot;) 
      public void receive(MyType message) {
          // process message
      }
  }
  </code></pre>
  <p>In certain cases, I want to shut down my application. However, before doing so I would like to stop the RabbitListner from consuming new messages and give it some time to finish the processing of already received messages.</p>
  <p>In spring this should be possible via <code>RabbitListenerEndpointRegistry#getListenerContainer(String)</code> according to <a href="https://stackoverflow.com/questions/41035454/how-to-stop-consuming-messages-with-rabbitlistener">How to stop consuming messages with @RabbitListener</a> and <a href="https://stackoverflow.com/questions/55991826/how-to-gracefully-stop-consuming-messages-with-rabbitlistener">How to gracefully stop consuming messages with @RabbitListener</a> .<br />
  I didn’t find something similar for Micronaut. Is this possible with Micronaut?</p>