[ 
https://issues.apache.org/jira/browse/AMQ-7070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16645848#comment-16645848
 ] 

Alan Protasio commented on AMQ-7070:
------------------------------------

Unfortunately, the only solution that I found for this is discarding the 
messages from the cache. Maybe this is not a big deal this only happens when we 
are disabling the cache anyway and after the first time the the cache, we need 
to fill it back from the storage anyway until the cursor became empty again 
(size = 0).

See: 
https://github.com/apache/activemq/blob/master/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java#L286

I tried to only try to fill the cursor when each priority is exhausted (in 
theAbstractStoreCursor.hasNext method for example) but the problem is if we do 
this and messages are being sent with different priorities,  we will be trying 
to fill the cursor from the storage all the time (to make sure that the next 
has the right priority).

> Priority is not being respected when the cursor cache flips
> -----------------------------------------------------------
>
>                 Key: AMQ-7070
>                 URL: https://issues.apache.org/jira/browse/AMQ-7070
>             Project: ActiveMQ
>          Issue Type: Test
>          Components: Broker
>            Reporter: Alan Protasio
>            Priority: Minor
>         Attachments: AMQ7070Test.java
>
>
> Messages are being dispatched with wrong priority when the cache is flipped.
> See: 
> https://github.com/apache/activemq/blob/master/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java#L258
> All messages that could get cached in the cursor are dispatched before even 
> though massages with higher priority is in the cache.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to