3 Replies Latest reply: Aug 30, 2011 4:36 AM by Nigeldeakin-Oracle RSS

    About onMessage

    885259
      Hello,

      I would like to know what happen if my application fail (lets suppose the computer break) before the onMessage() return (on a class that implement javax.jms.MessageListener). Suppose the acknowldge used is AUTO_ACKNOWLEDGE. What happen? The JMS Server was acknowledge or not?

      Thank you for the attention.
        • 1. Re: About onMessage
          883902
          If you are using "AUTO_ACKNOWLEDGE" in a non-transacted session, and application fail before control successfully returns from onMessage() method, JMS server will not be acknowledged.

          Go through this article, http://www.javaworld.com/javaworld/jw-02-2002/jw-0315-jms.html?page=1 , to make your understanding a bit more sound.

          I hope this helps.
          • 2. Re: About onMessage
            885259
            Yeah. Helps a lot. Thank you very much.
            • 3. Re: About onMessage
              Nigeldeakin-Oracle
              882256 wrote:
              Hello,

              I would like to know what happen if my application fail (lets suppose the computer break) before the onMessage() return (on a class that implement javax.jms.MessageListener). Suppose the acknowldge used is AUTO_ACKNOWLEDGE. What happen? The JMS Server was acknowledge or not?
              If onMessage() does not return successfully then the message will not be auto-acknowledged.

              See the javadoc for Session.AUTO_ACKNOWLEDGE:
              http://download.oracle.com/javaee/6/api/javax/jms/Session.html#AUTO_ACKNOWLEDGE
              this states that "With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message... when the message listener the session has called to process the message successfully returns. "

              Nigel