2 Replies Latest reply on Mar 20, 2013 6:01 AM by Frank Wilson

    Simple way to determine if queue has drained while batching acknowledgements

    Frank Wilson Newbie

      I find one thing a bit tricky with message acknowledgement. If I am writing a test I'd like the test to wait until the queue has drained before verifying that the consumer has done the work it is supposed to have done. If message batching is turned on the queue size reported by the core API won't always show the number of message that haven't been processed.

       

      e.g. If I send in 17 messages and the acknowledgement batch size is 100, the queue size will always read a non-zero size until the consumer has acked 100 messages. Is there some easy way to wait until the consumer is idle? Or maybe someway to commit acks after a timeout has expired?

       

      Thanks,

       

      Frank