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

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

                Author: ASF GitHub Bot
            Created on: 16/Mar/21 09:16
            Start Date: 16/Mar/21 09:16
    Worklog Time Spent: 10m 
      Work Description: gtully commented on a change in pull request #3490:
URL: https://github.com/apache/activemq-artemis/pull/3490#discussion_r594986451



##########
File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
##########
@@ -726,20 +728,44 @@ default long getWholeMessageSize() {
 
    /**
     * @return Returns the message properties in Map form, useful when encoding 
to JSON
+    * @param valueSizeLimit
     */
-   default Map<String, Object> toPropertyMap() {
+   default Map<String, Object> toPropertyMap(int valueSizeLimit) {
       Map map = new HashMap<>();
       for (SimpleString name : getPropertyNames()) {
          Object value = getObjectProperty(name.toString());
          //some property is SimpleString, which is not available for 
management console
          if (value instanceof SimpleString) {
             value = value.toString();
          }
+         value = truncate(value, valueSizeLimit);
          map.put(name.toString(), value);
       }
       return map;
    }
 
+   static Object truncate(final Object value, final int valueSizeLimit) {

Review comment:
       fair, will fix.
   thanks for all the feedback, it is fantastic.




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

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


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

    Worklog Id:     (was: 566807)
    Time Spent: 3h 40m  (was: 3.5h)

> Restrict/truncate messages attributes to a configurable limit for management 
> views
> ----------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3175
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3175
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: JMX
>    Affects Versions: 2.17.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.18.0
>
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> We still populate lots of per message data. ARTEMIS-3141 limits the number of 
> messages that are returned by default however the message data is still 
> displayed in full.
> With a few kbytes of data in message properties, it can quickly get become a 
> burden.
> The open type message body is called BodyPreview - but we put the whole body 
> in there at the moment.
> This enhancement will add an address setting - 
> *_managementMessageAttributeSizeLimit_*
> with a reasonable 256 default. 
> That will truncate all message attributes returned in JSON or JMX OpenData to 
> this value.
> Most properties will fit in that limit and be fully visible, anything bigger 
> will be difficult to view and is too much data to be exposing in bulk to a 
> console or client.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to