[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1664) Ordering Group is broken on server restart when messages are paged and reloaded

Howard Gao (JIRA) jira-events at lists.jboss.org
Mon Jul 20 06:36:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBMESSAGING-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12476827#action_12476827 ] 

Howard Gao commented on JBMESSAGING-1664:
-----------------------------------------

I plan to fix this in the following way:

1. Instead of loading only non-paged messages, we load all the messages from the table. This need to change the SQL statement

LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD

to 

LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY, PAGE_ORD FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD

We add the PAGE_ORD to the selected columns as we later need this value in the code.

2. In JDBCPersistenceManager.loadFromStart() method, it checks the PAGE_ORD value while iterating through the resultset. The first batch of messages with 'null' PAGE_ORD values are real non-paged message refs, so it loads them into memory queue. When it encounters the first message ref whose PAGE_ORD is not null, it stops loading any further message refs into memory queue. When it encounters the message ref with null PAGE_ORD again, it adds them to a list and in the end update those messages with proper PAGE_ORD values.

So this way, when the JBM server is restarted, the message order will be maintained.





> Ordering Group is broken on server restart when messages are paged and reloaded
> -------------------------------------------------------------------------------
>
>                 Key: JBMESSAGING-1664
>                 URL: https://jira.jboss.org/jira/browse/JBMESSAGING-1664
>             Project: JBoss Messaging
>          Issue Type: Bug
>          Components: Messaging Core
>    Affects Versions: 1.4.0.SP3.CP08, 1.4.4.GA
>            Reporter: Howard Gao
>            Assignee: Howard Gao
>             Fix For: 1.4.0.SP3.CP09, 1.4.5.GA
>
>
> When messages are paged into the DB and reloaded on server restart, the strict is broken.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list