You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/10/29 03:55:31 UTC

[GitHub] [activemq-artemis] brusdev commented on a change in pull request #3824: ARTEMIS-3535 bytes messages not obeying management limit

brusdev commented on a change in pull request #3824:
URL: https://github.com/apache/activemq-artemis/pull/3824#discussion_r738915948



##########
File path: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
##########
@@ -1345,7 +1345,13 @@ protected void init() throws OpenDataException {
          rc.put(CompositeDataConstants.TYPE, m.getType());
          if (!m.isLargeMessage()) {
             ActiveMQBuffer bodyCopy = m.getReadOnlyBodyBuffer();
-            byte[] bytes = new byte[bodyCopy.readableBytes() <= valueSizeLimit ? bodyCopy.readableBytes() : valueSizeLimit + 1];
+            int arraySize;
+            if (valueSizeLimit == -1 || bodyCopy.readableBytes() <= valueSizeLimit) {
+               arraySize = bodyCopy.readableBytes();
+            } else {
+               arraySize = valueSizeLimit + 1;

Review comment:
       why does it need valueSizeLimit **+ 1** ?




-- 
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-unsubscribe@activemq.apache.org

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