diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java index bb55d195b0..02819e5c0b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java @@ -403,6 +403,24 @@ public interface ActiveMQServerControl { @Attribute(desc = "whether the initial replication synchronization process with the backup server is complete") boolean isReplicaSync(); + /** + * Returns how often the server checks for disk space usage. + */ + @Attribute(desc = "how often to check for disk space usage, in milliseconds") + int getDiskScanPeriod(); + + /** + * Returns the disk use max limit. + */ + @Attribute(desc = "maximum limit for disk use, in percentage") + int getMaxDiskUsage(); + + /** + * Returns the global max bytes limit for in-memory messages. + */ + @Attribute(desc = "global maximum limit for in-memory messages, in bytes") + long getGlobalMaxSize(); + // Operations ---------------------------------------------------- /** diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index 362b74aa44..58b21c3104 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -545,6 +545,45 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active } } + @Override + public int getDiskScanPeriod() { + checkStarted(); + + clearIO(); + try { + return configuration.getDiskScanPeriod(); + } + finally { + blockOnIO(); + } + } + + @Override + public int getMaxDiskUsage() { + checkStarted(); + + clearIO(); + try { + return configuration.getMaxDiskUsage(); + } + finally { + blockOnIO(); + } + } + + @Override + public long getGlobalMaxSize() { + checkStarted(); + + clearIO(); + try { + return configuration.getGlobalMaxSize(); + } + finally { + blockOnIO(); + } + } + @Override public void deployQueue(final String address, final String name, final String filterString) throws Exception { checkStarted(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java index 3d083e249c..0d81e93d95 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java @@ -509,6 +509,21 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes return (Boolean) proxy.retrieveAttributeValue("PersistenceEnabled"); } + @Override + public int getDiskScanPeriod() { + return (Integer) proxy.retrieveAttributeValue("DiskScanPeriod", Integer.class); + } + + @Override + public int getMaxDiskUsage() { + return (Integer) proxy.retrieveAttributeValue("MaxDiskUsage", Integer.class); + } + + @Override + public long getGlobalMaxSize() { + return (Long) proxy.retrieveAttributeValue("GlobalMaxSize", Long.class); + } + @Override public void addSecuritySettings(String addressMatch, String sendRoles,