gtully commented on a change in pull request #3876:
URL: https://github.com/apache/activemq-artemis/pull/3876#discussion_r766556451



##########
File path: 
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
##########
@@ -765,11 +810,19 @@ public AMQConnectionContext initContext(ConnectionInfo 
info) throws Exception {
       createInternalSession(info);
 
       // the actor can only be used after the WireFormat has been initialized 
with versioning
-      this.openWireActor = new Actor<>(executor, this::act);
+      this.openWireActor = new BoundActor<>(executor, this::act, maxActorSize, 
this::getSize, this::disableAutoRead, this::flushedActor);
 
       return context;
    }
 
+   private int getSize(Command command) {
+      if (command instanceof ActiveMQMessage) {
+         return ((ActiveMQMessage) command).getSize();

Review comment:
       did a quick check, the only way getSize would return a different value 
after act is if org.apache.activemq.command.ActiveMQMessage#clearProperties was 
called and from what I can see we don't do that so this is a reasonable 
estimate. 
   The 1k for other commands may be a little heavy, but I guess it is better to 
error on the side of caution. 
   nice!




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to