Repository: activemq-artemis Updated Branches: refs/heads/master f282dff57 -> 305d16fd3
ARTEMIS-1096 Fixing configuration issues on calculated global-max-page Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/4e59c174 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/4e59c174 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/4e59c174 Branch: refs/heads/master Commit: 4e59c174ff378ffbc550ceb3fe7549fa58e62774 Parents: f282dff Author: Clebert Suconic <[email protected]> Authored: Tue Apr 11 10:08:17 2017 -0400 Committer: Clebert Suconic <[email protected]> Committed: Tue Apr 11 14:06:44 2017 -0400 ---------------------------------------------------------------------- .../artemis/cli/commands/etc/global-max-specified.txt | 1 - .../artemis/core/deployers/impl/FileConfigurationParser.java | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4e59c174/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/global-max-specified.txt ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/global-max-specified.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/global-max-specified.txt index afea35b..4d617b2 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/global-max-specified.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/global-max-specified.txt @@ -1,4 +1,3 @@ <!-- the system will enter into page mode once you hit this limit. This is an estimate in bytes of how much the messages are using in memory --> - <!-- <global-max-size>${global-max-size}</global-max-size> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4e59c174/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java index 03a8605..030f531 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java @@ -316,7 +316,13 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { config.setConfigurationFileRefreshPeriod(getLong(e, "configuration-file-refresh-period", config.getConfigurationFileRefreshPeriod(), Validators.GT_ZERO)); - config.setGlobalMaxSize(getTextBytesAsLongBytes(e, GLOBAL_MAX_SIZE, config.getGlobalMaxSize(), Validators.MINUS_ONE_OR_GT_ZERO)); + long globalMaxSize = getTextBytesAsLongBytes(e, GLOBAL_MAX_SIZE, -1, Validators.MINUS_ONE_OR_GT_ZERO); + + if (globalMaxSize > 0) { + // We only set it if it's not set on the XML, otherwise getGlobalMaxSize will calculate it. + // We do it this way because it will be valid also on the case of embedded + config.setGlobalMaxSize(globalMaxSize); + } config.setMaxDiskUsage(getInteger(e, MAX_DISK_USAGE, config.getMaxDiskUsage(), Validators.PERCENTAGE));
