-
1. Re: Message Counters: they don't appear to decrement
ataylor Dec 16, 2013 3:41 AM (in response to dlmarion)yes that is the expected behaviour, a message counter counts messages from a point in time its not the actual count on the queue, you reset it as and when you need. the countMessages method will give you the actual queue count
-
2. Re: Message Counters: they don't appear to decrement
dlmarion Dec 16, 2013 8:08 AM (in response to ataylor)Thanks for your response. Is that QueueControl.countMessages()? Is that an expensive operation? I'm curious why this is not exposed via JMX, even if calculated at some larger time interval.
-
3. Re: Message Counters: they don't appear to decrement
ataylor Dec 16, 2013 8:18 AM (in response to dlmarion)or getMessageCount if you dont need to pass a filter string which has little impact, countMessages will have a bigger impact since it has to traverse the queue.
-
4. Re: Message Counters: they don't appear to decrement
dlmarion Dec 16, 2013 10:33 AM (in response to ataylor)In my example I call QueueControl.listMessageCounters() and tried both the getCount() and getDepth() methods. Both of these continued to increment. I'm assuming that listMessageCounters().getCount() is the same as getMessageCount(), is that incorrect? I'll play around with it when I get home from work. Thanks.
-
5. Re: Re: Message Counters: they don't appear to decrement
dlmarion Dec 16, 2013 7:42 PM (in response to ataylor)ataylor : I modified my example to use QueueControl.getMessageCount() and QueueControl.countMessages(null). Neither worked. I have attached my updated sample.
-
6. Re: Re: Message Counters: they don't appear to decrement
ataylor Dec 17, 2013 2:29 AM (in response to dlmarion)its because the messages havent been acknowledged, with core messages are acked in batches for perf reasons, you can set this on the locator via locator.setAckBatchSize(1) or alternatively the messages will be acked when you close the session.
-
7. Re: Message Counters: they don't appear to decrement
dlmarion Dec 17, 2013 8:20 AM (in response to ataylor)Setting locator.setAckBatchSize() did the trick. Both QueueControl.getMessageCount() and QueueControl.countMessages(null) show the counts decrementing. I would have responded faster but I am being throttled by the forum software. Thanks.