2 Replies Latest reply on May 12, 2005 6:12 PM by adrian.brock

    Fail to acknowledge a JMS message

    jplsaez22

      Hello everbody.

      Just suppose a message-driven bean using bean-managed transactions, with the acknowledgment mode set to AUTO_ACKNOWLEDGE.

      If the onMessage finish successfully, the consumed message should be acknowledged, so that it is removed from the queue.

      What will happen if the underlying acknowledgement process fails and the message is not really removed from the queue?

      Will that message be available in the future?

      In that case, is there any way to know it's a duplicated message?

      Thank you very much

      Juan Pedro Lopez

        • 1. Re: Fail to acknowledge a JMS message
          genman

          Well, obvious you test for this sort of case.

          But AFAIK, JBoss won't send duplicate messages.

          • 2. Re: Fail to acknowledge a JMS message

            Genman, the first part of your answer is correct.
            "Suck it and see", or just read the spec.
            HINT: JMSMessage.getJMSRedelivered()

            The second part is not correct/misleading.
            Though it is quite hard for a BMT MDB to signal a NACK/rollback,
            short of crashing the server :-)
            See the FAQ or the dozens of previous posts where this is discussed in detail.

            You can tell there are previous posts discussing this, because it is an FAQ.

            Moderated: Lazy user