[jboss-user] [JBoss Messaging] - Re: How do I empty a JBoss queue?

asaur do-not-reply at jboss.com
Tue Jul 29 17:30:53 EDT 2008


"timfox" wrote : If you have well written clients which always close their connection(s) properly before exiting then any unacknowledged messages will be returned immediately to the queue(s) on close of those connection(s), otherwise the after the client exits the server will eventually time out that client and close its resources automatically. That time is governed by the ping settings (see user guide)

Sorry for the delay, I was checking all my code and trying to reproduce the error again. Unfortunately, my problem still persists: of course, as a 'good' client, I try to close the connection I'm using when I'm going down. The problem might come from the fact that this client is a web server and that there are 5 threads (consumers) consuming the queue. Sometimes the server stops BEFORE the threads are able to close properly; in other words, the thread is destroyed rather than properly finished.

I simulated today 2 distinct situations: first, the client crashes and the server ended up with 4 messages. These were consumed right after the client started again and connected - I can say that by reading my client logs that (when in debug mode) tell me each time the client consumes a message. I reckon this is the way it should be. In the second try, the queue ended up with 8 messages after the client crashed. However, for some unknown reason, this time the messages were not consumed by the client when it started again and connected. They simply stood there. Unfortunately, it gets worse: whenever a producer sends a message to that queue, its size is increased by 1 and the new message is not consumed too. So, after many client restarts, my problem is still there: the size is increasing and the consumer is not consuming. Right now, I have 16 messages to be delivered, a client that should be consuming but it's not, and the not so good possibility that the only way to get things back in place is a restart of the server (which seems to be the only way to empty the queue).

Lastly, to try to further explain things I used a MySQL terminal to make a query that listed all my messages in that queue; I can't post the results here, but I can comment a bit on them. The messages have a distinct 'message_id', 'transaction_id' null, 'state' = 'C', a distinct 'ord' number, 'page_ord' null, 'delivery_count' = '0' and 'sched_delivery' = '0'. Does this help in any way?



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167449#4167449

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167449




More information about the jboss-user mailing list