title: Redeliver message in JMS
body: <p>I am trying to read a message from Solace. I am able to read message successfully, but suppose while reading/processing the message the app crashes. How can I read that message again? With my below code I am not able to read that message again. Below is my configuration:</p>
  <pre class="lang-java prettyprint-override"><code>@JmsListener(destination = &quot;myqueue&quot;, containerFactory = &quot;jmsContainer&quot;, concurrency = &quot;5-10&quot;)
  public void onMessage(Message msg) {
      String message;
      if (msg instanceof TextMessage) {
          message = ((TextMessage) msg).getText();
          LOG.info(&quot;In here START &quot; +  message) ;
          Thread.sleep(60000); //I crash my app while thread is sleeping here
          LOG.info(&quot;In here END &quot; +  msg.getJMSDestination() ) ;
          
      }
  </code></pre>
  <pre class="lang-java prettyprint-override"><code>public class SolaceConfig {
  
      @Bean(&quot;solaceJndiTemplate&quot;)
      public JndiTemplate solaceJndiTemplate() {
          JndiTemplate solaceJndiTemplate = new JndiTemplate();
      
             // setting user name /password ommitted for brevity
  
              solaceJndiTemplate.setEnvironment(properties);
              
          
          return solaceJndiTemplate;
      }   
      
      @Bean
      public JndiObjectFactoryBean solaceConnectionFactory(){
          
          JndiObjectFactoryBean solaceConnectionFactory = new JndiObjectFactoryBean();
          solaceConnectionFactory.setJndiTemplate(solaceJndiTemplate());
          solaceConnectionFactory.setJndiName(getJndiName());
          return solaceConnectionFactory;
      }
  
      @Primary
      @Bean
      public CachingConnectionFactory solaceCachedConnectionFactory(){
          CachingConnectionFactory solaceCachedConnectionFactory = new CachingConnectionFactory();
          solaceCachedConnectionFactory.setTargetConnectionFactory((ConnectionFactory)solaceConnectionFactory().getObject());
          solaceCachedConnectionFactory.setSessionCacheSize(10);
          return solaceCachedConnectionFactory;
      }
  
      @Bean
      public JmsTemplate jmsTemplate() {
          JmsTemplate jmsTemplate = new JmsTemplate(solaceCachedConnectionFactory());
          jmsTemplate.setDeliveryPersistent(true);
          jmsTemplate.setExplicitQosEnabled(true);
          return jmsTemplate;
      }
  
      @Bean
      public DefaultJmsListenerContainerFactory jmsContainer() {
          DefaultJmsListenerContainerFactory container = new DefaultJmsListenerContainerFactory();
          container.setConnectionFactory(solaceCachedConnectionFactory());
      //container.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
          return container;
      }
  </code></pre>