clebertsuconic edited a comment on issue #3044: ARTEMIS-2676 
PageCursorProviderImpl::cleanup can save decoding pages without large messages
URL: https://github.com/apache/activemq-artemis/pull/3044#issuecomment-606911209
 
 
   I could fix the rebasing, however your implementation is not valid.
   
   Up until CoreMessages, we used a special record type on paging, only used 
for Large Messages.
   
   With AMQP, I didn't use that record at all. instead I used the Persister 
from the AMQP Protocol. So, you would have to check the Persister Type, at the 
proper record position.
   
   Besides, the following implementation is not self documented... if things 
change this will likely introduce bugs (lack of encapsulation of this rule):
   
   ```
      public static boolean isLargeMessage(ActiveMQBuffer buffer) {
         // skip transactionID
         final boolean isLargeMessage = buffer.getByte(buffer.readerIndex() + 
Long.BYTES) != 0;
         return isLargeMessage;
      }
   ```
   
   
   You would need to encapsulate this through PagePosition for Core Records, or 
check the Persister, and do the proper encapsulation if you really want to 
implement such feature.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to