title: How to stop and start jms listener
body: <p>I'm using Spring and I have a JMS queue to send messages from client to server. I'd like to stop the messages from being sent when the server is down, and resend them when it's back up.</p>
  
  <p>I know it was asked before but I can't make it work. I created a JmsListener and gave it an ID, but I cannot get it's container in order to stop\start it. </p>
  
  <pre><code>@Resource(name="testId")
  private AbstractJmsListeningContainer _probeUpdatesListenerContainer;
  
  public void testSendJms() {
  
      _jmsTemplate.convertAndSend("queue", "working");
  }
  
  @JmsListener(destination="queue", id="testId")
  public void testJms(String s) {
      System.out.println("Received JMS: " + s);
  
  }
  </code></pre>
  
  <p>The container bean is never created. I also tried getting it from the context or using @Autowired and @Qualifier("testId") with no luck. </p>
  
  <p>How can I get the container?</p>