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

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

                Author: ASF GitHub Bot
            Created on: 06/Mar/24 15:33
            Start Date: 06/Mar/24 15:33
    Worklog Time Spent: 10m 
      Work Description: tabish121 commented on code in PR #4840:
URL: https://github.com/apache/activemq-artemis/pull/4840#discussion_r1514696844


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java:
##########
@@ -320,28 +325,45 @@ public final void onMessage(Delivery delivery) throws 
ActiveMQAMQPException {
             return;
          }
 
-         final Message message = messageReader.readBytes(delivery);
+         {
+            Message completeMessage;
+            if ((completeMessage = messageReader.readBytes(delivery)) != null) 
{
+               // notice the AMQP Large Message Reader will always return false
+               // and call the onMessageComplete directly
+               // since that happens asynchronously
+               onMessageComplete(delivery, completeMessage, 
messageReader.getDeliveryAnnotations());
+            }
+         }
+      } catch (Exception e) {
+         logger.warn(e.getMessage(), e);
+         throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
+      }
+   }
 
-         if (message != null) {
-            // Fetch this before the close of the reader as that will clear 
any read message
-            // delivery annotations.
-            final DeliveryAnnotations deliveryAnnotations = 
messageReader.getDeliveryAnnotations();
+   public void onMessageComplete(Delivery delivery,
+                          Message message, DeliveryAnnotations 
deliveryAnnotations) {
+      connection.requireInHandler();
 
-            this.messageReader.close();
-            this.messageReader = null;
+      try {
+         final Receiver receiver = ((Receiver) delivery.getLink());

Review Comment:
   I realized it afterwards, it isn't really needed as it shouldn't ever be a 
receiver that isn't the one we have tracked but guess its fine either way, 
removing unneeded code is usually a nice thing. 





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

    Worklog Id:     (was: 908588)
    Time Spent: 7.5h  (was: 7h 20m)

> Move AMQP Large Message File Handling away from Netty thread
> ------------------------------------------------------------
>
>                 Key: ARTEMIS-4668
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4668
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.32.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.33.0
>
>          Time Spent: 7.5h
>  Remaining Estimate: 0h
>
> Operations like file.open, file.close, and file.sync should be moved away 
> from the Netty Thread for AMQP Large Messages
> This task now is about moving the processing for AMQP Messages. we may in a 
> near future also improve tunneled large messages. For now we will do for AMQP 
> messages only.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to