[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Paging discussion:
by timfox
"clebert.suconic(a)jboss.com" wrote : I have added some size controlling per Address on the PostOffice.
|
| Whenever a message is routed, I'm adding the getEncodeSize() of the message to the PostOffice, and when the message is develiered I'm subtracting the queue size on the PostOffice.
|
You should do the subtraction when the message is completely *acknowledged* (i.e. acked by all references) not when *delivered*. When it's delivered it's still in memory (the deliveries list in the session).
anonymous wrote :
| To perform the "when the message is delivered" control,
|
You mean "when the message is acked" :)
anonymous wrote :
| I am adding the reference counting logic. When the counter==0 on the ACK of the message, I'm calling a method on the postOffice informing that the message was delivered and that method is subtracting the encode size of the address. If the size < watermark I start a depage thread.
|
This is done on a separate thread?
ServerMessage already does reference counting - but only for durable messages. Instead of adding new methods you could just extend what is already there.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171320#4171320
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171320
17 years, 7 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Paging discussion:
by clebert.suconic@jboss.com
I have added some size controlling per Address on the PostOffice.
Whenever a message is routed, I'm adding the getEncodeSize() of the message to the PostOffice, and when the message is develiered I'm subtracting the queue size on the PostOffice.
When the size hits the minimal size I set the address in page mode, and after that moment all the messages are being sent to the page instead of routing.
To perform the "when the message is delivered" control, I am adding the reference counting logic. When the counter==0 on the ACK of the message, I'm calling a method on the postOffice informing that the message was delivered and that method is subtracting the encode size of the address. If the size < watermark I start a depage thread.
The address will be in page mode until all the page files are consumed, and at that point the Address comes back to its regular state automatically. (There is a startPaging method on PagingManager, and there is no stopPaging method. The "stopPaging" event happens when everything is dequeued).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171304#4171304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171304
17 years, 7 months