title: Redeliver message to MQ when using @JmsListener
body: <p>I'm using @EnableJms and @JmsListener annotation to register a queue listener in my application, basing on <a href="https://www.baeldung.com/spring-jms" rel="nofollow noreferrer">this</a> tutorial. I'm connecting to IBM MQ, getting connection factory using jndi. I have read about acknowledge modes etc. but still it's a new thing to me. And my problem is that the message is not being returned to a queue (the listener is never called again). </p>
  
  <pre><code>@Bean
  public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
      DefaultJmsListenerContainerFactory factory 
        = new DefaultJmsListenerContainerFactory();
      factory.setConnectionFactory(connectionFactory());
      factory.setSessionTransacted(true);
      factory.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE); //I have tried also CLIENT_ACKNOWLEDGE
      return factory;
  }
  
  
  @JmsListener(containerFactory = "jmsListenerContainerFactory", destination = "myQueue")
  @SendTo("secondQueue")
  public String testListener(String message){
   if(true) throw new NullPointerException();
   else return message;
  }
  </code></pre>
  
  <p>Any help would be much appreciated. 
  I would have also a second question. From what I understand if I would like to implement any operation on a database, only way to rollback a commit (if something went wrong after this) would be to create a transaction manager? If not, I would need to detect a duplicated message.</p>