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

clebert.suconic@jboss.com do-not-reply at jboss.com
Thu Aug 21 11:04:57 EDT 2008


As we were talking over IRC, transactions on paging are a little bit more complicated. 

We could have multiple destinations in page-mode and we need to guarantee a single commit/rollback point for those.


To correctly deal with transactions on those cases, I'm planning to use the journal to control the completeness of the transaction.

This is the current solution I have in mind:

I - When a message is sent transactionally to an address in page-mode, I will aways send it with the TransactionID

II - When (before) the transaction is completed (Prepare/Commit) I will add a new record on the Journal that will contain the number of Messages on Page (I'm calling this PageTransaction).  (We will hold the PageTransactions somewhere on the memory).


III - When depaging, I will verify if there is a PageTransaction available,
       If not, I will verify if there is a transaction pending. (i.e. transaction has started but committed wasn't called yet).  
       If pending transaction -> The depaged messages will be on wait mode until the commit is called.
       else (no pending transaction) -> The messages will be just discarded as that means the transaction was aborted somehow (rollback or server aborted on another server's execution).
       if evertyhing was OK while depaging I will update the PageTransaction on the journal with the numberOfMessages consumed, or delete the PageTransaction if numberOfMessages = 0, so that would release the record for reclaiming.


In summary three is:

During depage:
   It has a page-transaction
         - update page-transaction NRMessage = NRMessage - NRMessagesOnThePage
                  (Delete it if 0)
         - send the messages to the PostOffice/Journal
   It doesn't have a page-transaction
         if there is a pending transaction.. put those messages waiting for the transaction complete
         else... transaction is aborted
  


The only downside of this is if the user has 1 transaction for each message, while the user is sending 1 million messages. (1 million transactions on the memory). But that would be an anti-pattern and I don't know how we could guarantee atomicity without the journal at this point.





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

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



More information about the jboss-dev-forums mailing list