[ 
https://issues.apache.org/jira/browse/ARTEMIS-1975?focusedWorklogId=409588&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-409588
 ]

ASF GitHub Bot logged work on ARTEMIS-1975:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Mar/20 15:29
            Start Date: 25/Mar/20 15:29
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on 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
   eg Just to write here an example: 
https://netty.io/4.1/api/io/netty/buffer/ByteBuf.html#readRetainedSlice-int-
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 409588)
    Time Spent: 4h 50m  (was: 4h 40m)

> Real LargeMessage support for AMQP
> ----------------------------------
>
>                 Key: ARTEMIS-1975
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1975
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.6.2, 2.11.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.12.0
>
>          Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> This task in between a bug and an improvement.
>  
> Currently LargeMessages in AMQP are converted to Core.
> We should at least not require a conversion.. keep large messages in AMQP 
> without conversions.
>  
> Optionally it would be nice to stream in AMQP as well. but if we can at least 
> prevent conversions it's already a big win!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to