[jboss-user] [JBoss Messaging] - Re: Signaling to Partial Queue to Stop Accepting New Message

vishalrao do-not-reply at jboss.com
Fri Jun 27 17:59:59 EDT 2008


Hey everyone,

Still no responses.  Please let me know if you need me 
to clarify the question.

Also, any pointers to research materials or directions 
would be greatly appreciated.

On this front, I've been running some experiments to see
if I can use the MaxSize parameter to see if I can block
further messages from getting to the queue.  

Here are my findings which I think are pretty interesting:


Experiment #1: Try to set MaxSize to 0 after some message content

1.	Initial State  
------------"Queue4" Partial Queue on Node3 is empty and online
------------Node 1 and Node 2 are offline
2.	Use producer to send 200 messages to "Queue4"
3.	verify messages get there using HermesJMS
4.	verify messagecount in "Queue4" Mbean page
5.	Use Mbean page to set MaxSize to 0 from current value of -1
6.	Warning: JBoss Console message says you can't do it, but Mbean page reflects new value of 0
7.	Use HermesJMS to verify 200 messages are still there  (page through contents)
8.	Use Mbean page to verify 200 messages still there
9.	Try to send 200 more messages to queue using producer
10.	Hermes and Mbean Page both reflect 400 messages!

Conclusion: MaxSize of 0 does not prevent new messages from being added




BETWEEN EXPERIMENT #1 and #2

Mbean.removeAllMessages()




Experiment #2:  Try to set MaxSize to 0 before any messages

1.	Initial State  
------------a. "Queue4" Partial Queue on Node3 is empty and online
------------b. Node 1 and Node 2 are offline
2.	MaxSize is 0  (previous state from last experiment)
3.	Use producer to send 200 messages to "Queue4"
4.	verify all 200 messages get there using HermesJMS
5.	verify messagecount in Mbean page ==> 200

Conclusion: MaxSize of 0 does not prevent new messages from being added



BETWEEN EXPERIMENT #2 and #3

Mbean.removeAllMessages()


Experiment #3:  Try to set MaxSize to 1 before some messages

1.	Initial State  
-------------a. "Queue4" Partial Queue on Node3 is empty and online
-------------b. Node 1 and Node 2 are offline
2.	Use Mbean page to set MaxSize to 1 from current value of 0
3.	Use producer to send 200 messages
a.	Stack trace after 1st message
4.	Hermes and Mbean Page for "Queue4" both reflect 1 message


Conclusion: MaxSize of 1 correctly limits messages to 1



BETWEEN EXPERIMENT #3 and #4
Mbean.removeAllMessages()
MaxSize back to -1




Experiment #4: Try to set MaxSize to 1 after some messages are already in the queue

1.	Initial State  
-------------a.	"Queue4" Partial Queue on Node3 is empty and online
-------------b. Node 1 and Node 2 are offline
2.	Use producer to send 200 messages to "Queue4"
3.	verify messages get there using HermesJMS
4.	verify messagecount in Mbean page

5.	Use Mbean page to set MaxSize to 1 from current value of -1
6.	Use HermesJMS to verify 200 messages are still there  (page through contents)
7.	Use Mbean page to verify 200 messages still there
8.	Try to send 200 more messages to queue using producer
9.	Hermes and Mbean Page both reflect 400 messages!

Conclusion: MaxSize of 1 fails to limit message count to 1 when the message count is already exceeded.



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

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



More information about the jboss-user mailing list