franz1981 commented on a change in pull request #3048: ARTEMIS-1975 Fixing 
LargeMessage encoding for replication
URL: https://github.com/apache/activemq-artemis/pull/3048#discussion_r397925776
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java
 ##########
 @@ -126,6 +127,20 @@ public void closeLargeMessage() throws Exception {
       parsingData = null;
    }
 
+   public synchronized void releaseEncodedBuffer() {
+      if (temporaryBuffer != null && temporaryBuffer.release()) {
+         temporaryBuffer = null;
+      }
+   }
+
+   public synchronized ByteBuf getSavedEncodeBuffer() {
+      if (temporaryBuffer == null) {
+         temporaryBuffer = 
PooledByteBufAllocator.DEFAULT.buffer(getEstimateSavedEncode());
+         saveEncoding(temporaryBuffer);
+      }
+      return temporaryBuffer.retain();
 
 Review comment:
   I know but looking at the naming used on Netty I think is a good idea to 
communicate when something is to be relased after usage and when not, just to 
be less error prone...

----------------------------------------------------------------
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