2 Replies Latest reply on Nov 3, 2005 8:07 AM by Adrian Brock

    JBossMQ AUTO_ACKNOWLEDGE not working ?

    Daniel Aioanei Newbie

      I'm using the default cofiguration for jboss 4.0.3 and I have two standalone clients: one sends a single persistent message to a queue and that one works properly. After that I start the second standalone client which looks pretty much like this:

      Session s = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer consumer = s.createConsumer(destination);
      consumer.setMessageListener(new MessageListener() {
      public void onMessage(Message message) {
      throw new RuntimeException("please retry me");

      The first time I start the consumer application it receives the message properly but the second time and so on the message is no longer received and the web console shows the queue size to be zero.

      The behavior I see is not consistent with this excerpt from the jms 1.1 javadoc:

      public static final int AUTO_ACKNOWLEDGE

      With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.

      Is it a (known) bug ?