2 Replies Latest reply on Feb 19, 2013 11:28 AM by Frank Wilson

    Meaning of message count in core API.

    Frank Wilson Newbie

      In:

       

                  ClientSession coreSession = sf.createSession(false, true, true);
                  ClientSession.QueueQuery result =
                          coreSession.queueQuery(new SimpleString(QUEUE_NAME));
                  count = (int) result.getMessageCount();
      

       

      Is message count the cumulative total of messages added to the queue since it was created or the number of currently undelivered messages?

       

      This value never seems to go down despite me trying to acknowledge messages, etc. (Currently using 2.3.0.BETA1)

       

      Thanks,

       

      Frank

        • 1. Re: Meaning of message count in core API.
          Justin Bertram Master

          MessageCount is the number of currently undelivered messages.

           

          MessagesAdded is the cumulative total of messages added to the queue since it was created.

          • 2. Re: Meaning of message count in core API.
            Frank Wilson Newbie

            When I reattempted what I was trying to do I could get message count to behave as I was expected. In particular I made sure to seting the ack batching in my consume/producer session to 0 .

             

            i.e.

             

                    session = sf.createSession(

                            null, // user name

                            null, // password

                            false, // xa semantics

                            true, // auto commit sends

                            true, // auto commit acks

                            false, // pre-ack

                            0 // ack batch size

                    );

             

             

            By the way I could not find the MessagesAdded propery in the QueueQuery class, does this property come from somewhere else?