jbertram commented on code in PR #4825:
URL: https://github.com/apache/activemq-artemis/pull/4825#discussion_r1494916248


##########
artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java:
##########
@@ -344,7 +348,8 @@ public StompFrame createMessageFrame(ICoreMessage 
serverMessage, StompSubscripti
       }
       frame.setByteBody(data);
 
-      StompUtils.copyStandardHeadersFromMessageToFrame((serverMessage), frame, 
deliveryCount);
+      frame.addHeader(Stomp.Headers.Message.MESSAGE_ID, 
String.valueOf(consumer.getID()) + StompSession.MESSAGE_ID_SEPARATOR + 
String.valueOf(serverMessage.getMessageID()));

Review Comment:
   Message and consumer IDs should never be < 0 so the potential values are 0 
(1 character) through 9223372036854775807 (19 characters). Since these 
characters are just digits (i.e. part of ISO-8859-1) then they will be 
represented by a single byte in the `byte[]` that backs the `String`. We want 
to avoid expanding the backing array but we also want to avoid over-allocating 
(and therefore wasting) space. Ten characters for each long seems like a fair 
middle ground.



-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to