[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Paging discussion:

timfox do-not-reply at jboss.com
Tue Aug 19 12:27:59 EDT 2008


"clebert.suconic at 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



More information about the jboss-dev-forums mailing list