Github user michaelandrepearce commented on the issue: https://github.com/apache/activemq-artemis/pull/2490 @franz1981 pushed following changes based on your comments that agree with, for others i have left comment for us to discuss. Changes: 1) Ensured total size of the priority collection can never exceed Integer.MAX_VALUE, by ensuring this on add, thus the edge case you were worried about of the calcSize being greater than int cannot occur. Note if someone has that many consumers, we probably want to have some discussions with them as they would be some power user!!! ;) 2) Avoid double volatile read of changedIterator in reset method. 3) Removed need for a cast in MultiResettableIterator
---