gtully commented on a change in pull request #3490:
URL: https://github.com/apache/activemq-artemis/pull/3490#discussion_r594982852
##########
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) {
+ Object result = value;
+ if (valueSizeLimit > 0) {
Review comment:
ok, -1 it will be.
##########
File path:
artemis-jms-client/src/test/java/org/apache/activemq/artemis/jms/client/ConversionTest.java
##########
@@ -36,7 +36,7 @@ public void testCoreToJMSConversion() {
clientMessage.setDurable(true)
.setPriority((byte) 9)
.setExpiration(123456);
- Map<String, Object> messageMap = clientMessage.toMap();
+ Map<String, Object> messageMap = clientMessage.toMap(0);
Review comment:
agree
----------------------------------------------------------------
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]