-
1. Re: DestinationManagement - RemoveAllMessages()
timfox Feb 19, 2006 3:17 AM (in response to alexfu.novell)Add a method acknowledgeAll to the state.
For nonRecoverableState this removes from memory, for persistent state this removes from persistent storage, also needs to release refs as you have mentioned.
Don't worry about transactional state.
If a ref has been removed and a tx subsequently tries to ack it then it will just be ignored. Alternatively we could throw an exception at this point but I don't really see the need for that. -
2. Re: DestinationManagement - RemoveAllMessages()
timfox Feb 19, 2006 3:27 AM (in response to alexfu.novell)Also need to lock the channel exclusively for the duration of the operation.
-
3. Re: DestinationManagement - RemoveAllMessages()
alexfu.novell Feb 27, 2006 11:37 AM (in response to alexfu.novell)For Topics, there is a problem with removeAllMessages() because multiple subscriptions may have different states.
e.g. There are two subscriptions for a Topic and one of them is durable but offline; another is online. Messages sent to the Topic are successfully delivered to the online subscription's receiver but are still held in the offline subscription. And if now removeAllMessages() is applied, then all held messages in the offline subscription will disappear. From the Topic's point of view, different messages are removed from different subscriptions. This makes removeAllMessages() an undefined operation. -
4. Re: DestinationManagement - RemoveAllMessages()
timfox Feb 28, 2006 1:50 PM (in response to alexfu.novell)This can be done by locking all the channels corresponding to subscriptions for the topic and removing first their in memory state, then removing the state of any surable subs for the topic directly in the db.