diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java index ec6fe7ccd8..8330231ee5 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java @@ -161,8 +161,9 @@ public class DestinationView implements DestinationViewMBean { /** * @return the average size of a message (bytes) */ - public double getAverageMessageSize() { - return destination.getDestinationStatistics().getMessageSize().getAverageSize(); + public long getAverageMessageSize() { + // we are okay with the size without decimals so cast to long + return (long) destination.getDestinationStatistics().getMessageSize().getAverageSize(); } /** diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java index a42bcfa6d5..60340ffe81 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java @@ -264,12 +264,11 @@ public interface DestinationViewMBean { @MBeanInfo("The shortest time a message has been held this destination.") long getMinEnqueueTime(); - @MBeanInfo("Average time a message has been held this destination.") double getAverageEnqueueTime(); @MBeanInfo("Average message size on this destination") - double getAverageMessageSize(); + long getAverageMessageSize(); @MBeanInfo("Max message size on this destination") public long getMaxMessageSize();