diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java index 7d20cfde8c..61f0f5d0c0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java @@ -23,12 +23,16 @@ import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ComponentConfigurationRoutingType; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy; +import org.jboss.logging.Logger; /** * Default values of ActiveMQ Artemis configuration parameters. */ public final class ActiveMQDefaultConfiguration { - /* + + private static final Logger logger = Logger.getLogger(ActiveMQDefaultConfiguration.class); + + /* *

In order to avoid compile time in-lining of constants, all access is done through methods * and all fields are PRIVATE STATIC but not FINAL. This is done following the recommendation at * 13.4.9. @@ -467,7 +471,19 @@ public final class ActiveMQDefaultConfiguration { public static final long DEFAULT_GLOBAL_MAX_SIZE = Runtime.getRuntime().maxMemory() / 2; - public static final int DEFAULT_MAX_DISK_USAGE = 100; + public static final int DEFAULT_MAX_DISK_USAGE; + + static { + int maxDisk; + try { + maxDisk = Integer.parseInt(System.getProperty(ActiveMQDefaultConfiguration.getDefaultSystemPropertyPrefix() + "maxDiskUsage", "90")); + } catch (Throwable e) { + // This is not really supposed to happen, so just logging it, just in case + logger.warn(e); + maxDisk = 90; + } + DEFAULT_MAX_DISK_USAGE = maxDisk; + } public static final int DEFAULT_DISK_SCAN = 5000; diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd index 671bd2612d..14f70bea9e 100644 --- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd +++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd @@ -752,7 +752,7 @@ - Max percentage of disk usage before the system blocks or fail clients. + Max percentage of disk usage before the system blocks or fails clients. diff --git a/docs/user-manual/en/configuration-index.md b/docs/user-manual/en/configuration-index.md index d698bd85b9..6311f94e5c 100644 --- a/docs/user-manual/en/configuration-index.md +++ b/docs/user-manual/en/configuration-index.md @@ -79,6 +79,16 @@ This is to help you customize artemis on embedded systems. This describes the root of the XML configuration. You will see here also multiple sub-types listed. For example on the main config you will have bridges and at the [list of bridge](#bridge-type) type we will describe the properties for that configuration. +> **Warning** +> +> The default values listed below are the values which will be used if +> the configuration parameter is **not set** either programmatically or +> via `broker.xml`. Some of these values are set in the `broker.xml` +> which is available out-of-the-box. Any values set in the +> out-of-the-box configuration will override the default values listed +> here. Please consult your specific configuration to know which values +> will actually be used when the broker is running. + Name | Description | Default ---|---|--- [acceptors](configuring-transports.md#acceptors) | a list of remoting acceptors | n/a @@ -135,7 +145,7 @@ log-delegate-factory-class-name | **deprecated** the name of the factory class t [management-notification-address](management.md#configuring-the-management-notification-address) | the name of the address that consumers bind to receive management notifications. | `activemq.notifications` [mask-password](masking-passwords.md) | This option controls whether passwords in server configuration need be masked. If set to "true" the passwords are masked. | `false` [max-saved-replicated-journals-size](ha.md#data-replication) | This specifies how many times a replicated backup server can restart after moving its files on start. Once there are this number of backup journal files the server will stop permanently after if fails back. -1 Means no Limit; 0 don't keep a copy at all. | 2 -[max-disk-usage](paging.md#max-disk-usage) | The max percentage of data we should use from disks. The System will block while the disk is full. Disable by setting -1. | 100 +[max-disk-usage](paging.md#max-disk-usage) | The max percentage of data we should use from disks. The broker will block while the disk is full. Disable by setting -1. | 90 [memory-measure-interval](perf-tuning.md) | frequency to sample JVM memory in ms (or -1 to disable memory sampling). | -1 [memory-warning-threshold](perf-tuning.md)| Percentage of available memory which will trigger a warning log. | 25 [message-counter-enabled](management.md#message-counters) | true means that message counters are enabled. | `false` diff --git a/pom.xml b/pom.xml index 3b82a86ded..d57cbea266 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ --> - -Djava.util.logging.manager=org.jboss.logmanager.LogManager + -Dbrokerconfig.maxDiskUsage=100 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration="file:${activemq.basedir}/tests/config/logging.properties" -Djava.library.path="${activemq.basedir}/artemis-native/bin" -Djgroups.bind_addr=localhost -Dorg.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory.localBindAddress=localhost -Djava.net.preferIPv4Stack=true -Dbasedir=${basedir}