From 6507bf4a4d69508e3bb20fe65d66763030f4e754 Mon Sep 17 00:00:00 2001 From: JiriOndrusek Date: Mon, 23 Apr 2018 14:57:09 +0200 Subject: [PATCH] [ARTEMIS-1823] - Log warning on boot when persistence is disabled and paging enabled --- .../artemis/core/server/ActiveMQServerLogger.java | 4 ++++ .../artemis/core/server/impl/ActiveMQServerImpl.java | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java index c3f0a7d7048..6cd69aed605 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java @@ -1934,4 +1934,8 @@ void slowConsumerDetected(String sessionID, @LogMessage(level = Logger.Level.WARN) @Message(id = 224091, value = "Bridge {0} is unable to connect to destination. Retrying", format = Message.Format.MESSAGE_FORMAT) void errorConnectingBridgeRetry(Bridge bridge); + + @LogMessage(level = Logger.Level.INFO) + @Message(id = 224092, value = "Despite disabled persistence, page files will be persisted.", format = Message.Format.MESSAGE_FORMAT) + void pageWillBePersisted(); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java index 050a7762ca8..b5496a9be39 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java @@ -154,6 +154,7 @@ import org.apache.activemq.artemis.core.server.reload.ReloadManagerImpl; import org.apache.activemq.artemis.core.server.transformer.Transformer; import org.apache.activemq.artemis.core.settings.HierarchicalRepository; +import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.settings.impl.DeletionPolicy; import org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository; @@ -2323,6 +2324,16 @@ synchronized boolean initialisePart1(boolean scalingDown) throws Exception { deployAddressSettingsFromConfiguration(); } + //fix of ARTEMIS-1823 + if (!configuration.isPersistenceEnabled()) { + for (AddressSettings addressSettings : addressSettingsRepository.values()) { + if (addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.PAGE) { + ActiveMQServerLogger.LOGGER.pageWillBePersisted(); + break; + } + } + } + storageManager.start(); postOffice.start();