Ok, so it turns out I just wasn't patient enough. It was expiring messages eventually, it seems that it must do the expire check a little bit in advance and queue up a few messages to be processed first (or maybe it just how the threads are setup). Because once I attached a debugger around the message.isExpired(), I could see it expiring messages and while I had the thread paused, a whole bunch of messages were expired once I resumed.
When I watch the logs, it seemes to not expire messages for like the first 15-20 messages after JBoss starts up and then it started expiring messages every 5 messages or so.
Another thing I noticed while debugging is that is that <consumer-window-size>0</consumer-window-size>
was infact applying to the hornetq configuration, because the debugger was showing the value as 0. Although it didn't really have any real affect on when messages were being expired. So I'm not sure what the Bug I found was all about then, because it definately seems to be applying the configuration.
So thanks Clebert for your patience in helping me, and thanks to the others that offered suggestions too.
Take a look also at the MessageExpiryScanPeriod
Clebert Suconic wrote:
Take a look also at the MessageExpiryScanPeriod
If you look at my original post I set <message-expiry-scan-period>2000</message-expiry-scan-period>
but it didn't really seem to help. The debugger showed it was running every 2 seconds, but a lot of the time it was saying there was nothing in the queue, so someone told be about <consumer-window-size>0</consumer-window-size> I thought that would help the situation, but it didn't seem to make any noticable difference.
Thanks
Yes... the server scanning will only scan for messages that are not delivered to the clients.
As soon as you start consuming these messages on the client, they will be invalidated through the client as well.
The proper way is the expiry on the client actually, the server's scanning is just for when you don't have a consumer (Say your client application died and you want to make sure the queue won't be floaded because of the dead consumer).