Note that there are some explanatory texts on larger screens.

plurals
  1. POnon-transacted asynchronous JMS consumer - Auto_Acknowledge - message not going back on queue
    text
    copied!<p>I'm using Weblogic 12, and I've got a non-transacted asynchronous JMS consumer. I haven't setup the ack mode so it defaults to AUTO_ACKNOWLEDGE. I've confirmed this in the application.. see below.</p> <p>What I have done is to consume the message and then call exit to quit.</p> <p>I would expect that the JMS message would be on the queue after this consumer has run as the message should not be acknowledged until such time as the onMessage has fully completed. </p> <p>Instead the message no longer exists on the Weblogic JMS queue. Any ideas why not??? </p> <p>See below for my onMessage code and the output from the application.</p> <p>Thanks for the help.</p> <p>Here is my code</p> <pre><code>@Override public void onMessage(Message message, Session session) throws JMSException { logger.info("Session : Ack Mode : " + convertSamToString(session.getAcknowledgeMode())); logger.info("Session : Transacted? : " + session.getTransacted()); try { String msgText; if (message instanceof TextMessage) { msgText = ((TextMessage) message).getText(); } else { msgText = message.toString(); messages.add(msgText); } logger.info("&lt;Msg_Receiver&gt; [" + msgText + "]"); if (true) System.exit(2); // throw new RuntimeException("Exception during message consumption."); } catch (JMSException jmsEx) { logger.error("JMS Exception: ", jmsEx); throw new RuntimeException(jmsEx); } logger.info("Finished processing message."); } </code></pre> <p>Here is the output:</p> <pre><code>19 Nov 2013 16:24:26,079 INFO JmsConsumerApp - JmsConsumerApp starting. 19 Nov 2013 16:24:26,125 INFO ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@19616c7: startup date [Tue Nov 19 16:24:26 GMT 2013]; root of context hierarchy 19 Nov 2013 16:24:26,172 INFO XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [jmsConsumer-applicationContext.xml] 19 Nov 2013 16:24:26,360 INFO PropertyPlaceholderConfigurer - Loading properties file from class path resource [jms.properties] 19 Nov 2013 16:24:26,360 INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8acf6e: defining beans [org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor#0,jmsconfig,jndiTemplate,connectionFactory,jmsTransactionManager,paymentQueue,jmsConsumer,jmsConsumer1,jmsProducerListenerContainer1]; root of factory hierarchy 19 Nov 2013 16:24:26,750 INFO DefaultLifecycleProcessor - Starting beans in phase 2147483647 19 Nov 2013 16:26:22,433 INFO JmsMessageConsumer1 - Session : Ack Mode : AUTO_ACKNOWLEDGE 19 Nov 2013 16:26:22,433 INFO JmsMessageConsumer1 - Session : Transacted? : false 19 Nov 2013 16:26:22,433 INFO JmsMessageConsumer1 - &lt;Msg_Receiver&gt; [MyJMStestMessage] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload