clebertsuconic commented on a change in pull request #2497: ARTEMIS-2228 Check 
message size sent over management API
URL: https://github.com/apache/activemq-artemis/pull/2497#discussion_r247625597
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java
 ##########
 @@ -67,6 +71,23 @@ protected void blockOnIO() {
 
    }
 
+   /**
+    * This is used to limit the size of message that can be sent over
+    * management api. The message size shall be less than the journal
+    * buffer size.
+    * @param postOffice the PostOffice
+    * @param message the message to be checked
+    * @throws Exception if message size is over the limit.
+    */
+   protected void checkMessageSize(PostOffice postOffice, CoreMessage message) 
throws Exception {
+      int msize = message.getPersistSize();
+      ActiveMQServer server = postOffice.getServer();
+      int journalBufferSize = 
server.getConfiguration().getJournalBufferSize_AIO();
 
 Review comment:
   This is not right either. What if the current journal is NIO?
   
   i would expect a simpler change here.. just convert it to large message. 
Some protocols are already doing that..  let me check how that conversion is 
done and i will get back to you here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to