title: How to Schedule onMessage() method of JMS Listener
body: <p>I want that my listener will run in a interval of <strong>'x' minutes</strong>, I have gone through <strong>@Scheduled</strong> annotation of Spring, but I am not sure how to use it with jms listener, I would appreciate if anyone inputs on the same - </p>
  
  <pre><code>Here is my code snippet of Consumer
  
  @Override @Scheduled(cron="0 */x * * * *")
    public void onMessage(Message message) {
     try {
      LOG.info("+++++++++++++++++++++++++++++++");
      MailMessageObject response = (MailMessageObject)messageConverter.fromMessage(message);
      LOG.info("Application : failed message as a response: {}", response);
      LOG.info("+++++++++++++++++++++++++++++++");
  // Here we are getting failed message, again create mail and will           // send thru java mail
              SendMessageHelper help = new SendMessageHelper();
              help.abstractEmailSender(response);
  
      }
  </code></pre>