michaelandrepearce commented on a change in pull request #3490:
URL: https://github.com/apache/activemq-artemis/pull/3490#discussion_r594588424
##########
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:
This is private logic. Currently by doing this it be exposed on api
class. Do we really want to expose this? I would make this in an internal class
and call that method from default methods
----------------------------------------------------------------
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:
[email protected]