title: In SpringBoot how & when does @JmsListener gets called?
body: <p>I'm new to SpringBoot. Trying to build a simple non-web process where I listen to a MQ Queue and process the messages received. I tried various ways to acheive this in SB, but unfortunately I cant get the @JmsListener method to get called. No errors either &amp; the process just waits.</p>
  <p>All the MQ Queue details are in application.properties</p>
  <p>I did verify there are messages in the Queue and I could retrieve them using the old MQ receiver way.</p>
  <p><em>I would like to know how &amp; when does @JmsListener Annotation method gets called? I did try creating a JmsListenerContainerFactory and included it in the annotation params but made no difference.</em></p>
  <p>There are few examples similar to this, it looks simple but I just cant get it to work. Any suggestions are appreciated. Thanks.</p>
  <p><strong>Main SpringBoot Class</strong></p>
  <pre><code>@SpringBootApplication
  @EnableJms
  public class Application {
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  
  }
  </code></pre>
  <p><strong>MQListener Class</strong></p>
  <pre><code>@Component
  public class MQListener {
      @JmsListener(destination = &quot;${mq.queueName}&quot;)
      public void receiveMessage(final Message message) throws JMSException{
          System.out.println(&quot;...Message Received...&quot;);
          String messageData = null;
          if(message instanceof TextMessage) {
              TextMessage textMessage = (TextMessage)message;
              messageData = textMessage.getText();
          }
      }
  }
  
  </code></pre>
  <p><strong>MQConfiguration Class</strong></p>
  <pre><code>@Configuration
  public class MQConfiguration {
      @Value(&quot;${mq.host}&quot;)
      private String host;
      @Value(&quot;${mq.port}&quot;)
      private Integer port;
      @Value(&quot;${mq.queue-manager}&quot;)
      private String queueManager;
      @Value(&quot;${mq.channel}&quot;)
      private String channel;
      @Value(&quot;{mq.queueName}&quot;)
      private String queueName;
      @Value(&quot;${mq.receive-timeout}&quot;)
      private long receiveTimeout;
      
      @Bean
      public MQQueueConnectionFactory mqQueueConnectionFactory() {
          MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();
          mqQueueConnectionFactory.setHostName(host);
          try {
              mqQueueConnectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
              mqQueueConnectionFactory.setChannel(channel);
              mqQueueConnectionFactory.setPort(port);
              mqQueueConnectionFactory.setQueueManager(queueManager);
          } catch (Exception e) {
              e.printStackTrace();
          }
          return mqQueueConnectionFactory;
      }
  }
  </code></pre>