From 8cdf2f9fc25a99a009fbac3fc043799c556629a4 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Mon, 13 Jan 2025 12:57:43 -0600 Subject: [PATCH] ARTEMIS-5241 remove useless validation for cluster-connection confirmation-window-size --- .../core/config/impl/ConfigurationImpl.java | 26 ------------------- .../cluster/impl/ClusterConnectionImpl.java | 5 ---- .../config/impl/FileConfigurationTest.java | 9 ------- 3 files changed, 40 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java index 39c63a0acd5..894b4a4fbe0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java @@ -145,12 +145,6 @@ public class ConfigurationImpl implements Configuration, Serializable { public static final String PROPERTY_CLASS_SUFFIX = ".class"; - private static final int DEFAULT_JMS_MESSAGE_SIZE = 1864; - - private static final int RANGE_SIZE_MIN = 0; - - private static final int RANGE_SZIE_MAX = 4; - private static final long serialVersionUID = 4077088945050267843L; private String name = "localhost"; @@ -3231,26 +3225,6 @@ public ConfigurationImpl setPageSyncTimeout(final int pageSyncTimeout) { return this; } - public static boolean checkoutDupCacheSize(final int windowSize, final int idCacheSize) { - final int msgNumInFlight = windowSize / DEFAULT_JMS_MESSAGE_SIZE; - - if (msgNumInFlight == 0) { - return true; - } - - boolean sizeGood = false; - - if (idCacheSize >= msgNumInFlight) { - int r = idCacheSize / msgNumInFlight; - - // This setting is here to accomodate the current default setting. - if ((r >= RANGE_SIZE_MIN) && (r <= RANGE_SZIE_MAX)) { - sizeGood = true; - } - } - return sizeGood; - } - /** * It will find the right location of a subFolder, related to artemisInstance */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java index 3f5bdbefec4..9a0bd8ea6cc 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java @@ -48,7 +48,6 @@ import org.apache.activemq.artemis.core.client.impl.Topology; import org.apache.activemq.artemis.core.client.impl.TopologyManager; import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl; -import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.filter.impl.FilterImpl; import org.apache.activemq.artemis.core.postoffice.Binding; import org.apache.activemq.artemis.core.postoffice.PostOffice; @@ -931,10 +930,6 @@ private void createNewRecord(final long eventUID, if (start) { bridge.start(); } - - if (!ConfigurationImpl.checkoutDupCacheSize(serverLocator.getConfirmationWindowSize(), server.getConfiguration().getIDCacheSize())) { - ActiveMQServerLogger.LOGGER.duplicateCacheSizeWarning(server.getConfiguration().getIDCacheSize(), serverLocator.getConfirmationWindowSize()); - } } private class MessageFlowRecordImpl implements MessageFlowRecord { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java index de29b9ab8fe..08a3ec4bf8e 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java @@ -902,15 +902,6 @@ public void testBrokerPlugin() throws Exception { assertTrue(brokerPlugins.get(1) instanceof EmptyPlugin2); } - @TestTemplate - public void testDefaultConstraints() { - int defaultConfirmationWinSize = ActiveMQDefaultConfiguration.getDefaultClusterConfirmationWindowSize(); - int defaultIdCacheSize = ActiveMQDefaultConfiguration.getDefaultIdCacheSize(); - assertTrue(ConfigurationImpl.checkoutDupCacheSize(defaultConfirmationWinSize, defaultIdCacheSize), "check failed, " + defaultConfirmationWinSize + ":" + defaultIdCacheSize); - defaultConfirmationWinSize = ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize(); - assertTrue(ConfigurationImpl.checkoutDupCacheSize(defaultConfirmationWinSize, defaultIdCacheSize), "check failed, " + defaultConfirmationWinSize + ":" + defaultIdCacheSize); - } - @TestTemplate public void testJournalFileOpenTimeoutDefaultValue() throws Exception { ActiveMQServerImpl server = new ActiveMQServerImpl();