diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java index 1166413cdb..2257721458 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java @@ -109,7 +109,6 @@ public class QueueConfiguration implements Serializable { private Boolean internal; private Boolean _transient; private Boolean autoCreated; - private transient SimpleString pageStoreName; /** * Instantiate this object and invoke {@link #setName(SimpleString)} @@ -878,12 +877,4 @@ public class QueueConfiguration implements Serializable { + ", transient=" + _transient + ", autoCreated=" + autoCreated + ']'; } - - public void setPageStoreName(SimpleString pageStoreName) { - this.pageStoreName = pageStoreName; - } - - public SimpleString getPageStoreName() { - return pageStoreName != null ? pageStoreName : getAddress(); - } } 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 23a465232b..f3633ba3f4 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 @@ -296,7 +296,6 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { private static final String ENABLE_METRICS = "enable-metrics"; - private static final String PAGE_STORE_NAME = "page-store-name"; // Attributes ---------------------------------------------------- @@ -1267,8 +1266,6 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { addressSettings.setExpiryQueueSuffix(new SimpleString(getTrimmedTextContent(child))); } else if (ENABLE_METRICS.equalsIgnoreCase(name)) { addressSettings.setEnableMetrics(XMLUtil.parseBoolean(child)); - } else if (PAGE_STORE_NAME.equalsIgnoreCase(name)) { - addressSettings.setPageStoreName(new SimpleString(getTrimmedTextContent(child))); } } return setting; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java index 23828bfcdd..4f930b7f0f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java @@ -336,14 +336,6 @@ public final class PagingManagerImpl implements PagingManager { @Override public void deletePageStore(final SimpleString storeName) throws Exception { - final AddressSettings addressSettings = addressSettingsRepository.getMatch(storeName.toString()); - if (addressSettings != null && addressSettings.getPageStoreName() != null) { - if (logger.isTraceEnabled()) { - logger.tracev("not deleting potentially shared pageAddress {} match for {}", addressSettings.getPageStoreName(), storeName); - } - return; - } - syncLock.readLock().lock(); try { PagingStore store = stores.remove(storeName); @@ -360,16 +352,11 @@ public final class PagingManagerImpl implements PagingManager { * This method creates a new store if not exist. */ @Override - public PagingStore getPageStore(SimpleString storeName) throws Exception { + public PagingStore getPageStore(final SimpleString storeName) throws Exception { if (managementAddress != null && storeName.startsWith(managementAddress)) { return null; } - final AddressSettings addressSettings = addressSettingsRepository.getMatch(storeName.toString()); - if (addressSettings != null && addressSettings.getPageStoreName() != null) { - storeName = addressSettings.getPageStoreName(); - } - PagingStore store = stores.get(storeName); if (store != null) { return store; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java index e70fbdb0dd..12ef067669 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java @@ -49,11 +49,7 @@ public class AddressImpl implements Address { this.address = address; this.wildcardConfiguration = wildcardConfiguration; addressParts = address.split(wildcardConfiguration.getDelimiter()); - containsWildCard = isContainsWildCard(address, wildcardConfiguration); - } - - public static boolean isContainsWildCard(SimpleString address, WildcardConfiguration wildcardConfiguration) { - return address.contains(wildcardConfiguration.getSingleWord()) || address.contains(wildcardConfiguration.getAnyWords()); + containsWildCard = address.contains(wildcardConfiguration.getSingleWord()) || address.contains(wildcardConfiguration.getAnyWords()); } @Override 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 e1eaa92200..d95e3a186c 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 @@ -1706,9 +1706,6 @@ public interface ActiveMQServerLogger extends BasicLogger { "**************************************************************************************************************************************************************************************************************************************************************", format = Message.Format.MESSAGE_FORMAT) void possibleSplitBrain(String nodeID, String connectionPairInformation); - @LogMessage(level = Logger.Level.WARN) - @Message(id = 222295, value = "Subscription {0} uses wildcard address {1} but no matching address-setting has configured the shared page-store-name; counters may be inaccurate", format = Message.Format.MESSAGE_FORMAT) - void wildcardRoutingWithoutSharedPageStore(SimpleString queueName, SimpleString address); @LogMessage(level = Logger.Level.WARN) @Message(id = 222296, value = "Unable to deploy Hawtio MBeam, console client side RBAC not available", 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 e0c8636c60..4591b308ae 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 @@ -104,7 +104,6 @@ import org.apache.activemq.artemis.core.postoffice.Binding; import org.apache.activemq.artemis.core.postoffice.BindingType; import org.apache.activemq.artemis.core.postoffice.PostOffice; import org.apache.activemq.artemis.core.postoffice.QueueBinding; -import org.apache.activemq.artemis.core.postoffice.impl.AddressImpl; import org.apache.activemq.artemis.core.postoffice.impl.DivertBinding; import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding; import org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl; @@ -3560,12 +3559,7 @@ public class ActiveMQServerImpl implements ActiveMQServer { } } - final AddressSettings addressSettings = addressSettingsRepository.getMatch(getRuntimeTempQueueNamespace(queueConfiguration.isTemporary()) + queueConfiguration.getAddress().toString()); - QueueConfigurationUtils.applyDynamicQueueDefaults(queueConfiguration, addressSettings); - - if (AddressImpl.isContainsWildCard(queueConfiguration.getAddress(), configuration.getWildcardConfiguration()) && addressSettings.getPageStoreName() == null) { - ActiveMQServerLogger.LOGGER.wildcardRoutingWithoutSharedPageStore(queueConfiguration.getName(), queueConfiguration.getAddress()); - } + QueueConfigurationUtils.applyDynamicQueueDefaults(queueConfiguration, addressSettingsRepository.getMatch(getRuntimeTempQueueNamespace(queueConfiguration.isTemporary()) + queueConfiguration.getAddress().toString())); AddressInfo info = postOffice.getAddressInfo(queueConfiguration.getAddress()); if (queueConfiguration.isAutoCreateAddress() || queueConfiguration.isTemporary()) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java index 6f9788e08c..5bbf7c29ed 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java @@ -46,6 +46,5 @@ public class QueueConfigurationUtils { config.setAutoDeleteMessageCount(config.getAutoDeleteMessageCount() == null ? as.getAutoDeleteQueuesMessageCount() : config.getAutoDeleteMessageCount()); config.setEnabled(config.isEnabled() == null ? ActiveMQDefaultConfiguration.getDefaultEnabled() : config.isEnabled()); - config.setPageStoreName(as.getPageStoreName()); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java index 9b616ff41a..13e3c313b3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java @@ -140,7 +140,7 @@ public class QueueFactoryImpl implements QueueFactory { PageSubscription pageSubscription; try { - PagingStore pageStore = pagingManager.getPageStore(queueConfiguration.getPageStoreName()); + PagingStore pageStore = pagingManager.getPageStore(queueConfiguration.getAddress()); if (pageStore != null) { pageSubscription = pageStore.getCursorProvider().createSubscription(queueConfiguration.getId(), FilterImpl.createFilter(queueConfiguration.getFilterString()), queueConfiguration.isDurable()); } else { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java index 65da14b300..e713b08f54 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java @@ -253,8 +253,6 @@ public class AddressSettings implements Mergeable, Serializable private Boolean enableMetrics = null; - private SimpleString pageStoreName = null; - //from amq5 //make it transient private transient Integer queuePrefetch = null; @@ -320,7 +318,6 @@ public class AddressSettings implements Mergeable, Serializable this.defaultGroupFirstKey = other.defaultGroupFirstKey; this.defaultRingSize = other.defaultRingSize; this.enableMetrics = other.enableMetrics; - this.pageStoreName = other.pageStoreName; } public AddressSettings() { @@ -917,15 +914,6 @@ public class AddressSettings implements Mergeable, Serializable return this; } - public SimpleString getPageStoreName() { - return pageStoreName; - } - - public AddressSettings setPageStoreName(final SimpleString pageStoreName) { - this.pageStoreName = pageStoreName; - return this; - } - /** * merge 2 objects in to 1 * @@ -1119,9 +1107,6 @@ public class AddressSettings implements Mergeable, Serializable if (enableMetrics == null) { enableMetrics = merged.enableMetrics; } - if (pageStoreName == null) { - pageStoreName = merged.pageStoreName; - } } @Override @@ -1335,10 +1320,6 @@ public class AddressSettings implements Mergeable, Serializable defaultGroupRebalancePauseDispatch = BufferHelper.readNullableBoolean(buffer); } - if (buffer.readableBytes() > 0) { - pageStoreName = buffer.readNullableSimpleString(); - } - } @Override @@ -1402,8 +1383,7 @@ public class AddressSettings implements Mergeable, Serializable SimpleString.sizeofNullableString(expiryQueuePrefix) + SimpleString.sizeofNullableString(expiryQueueSuffix) + BufferHelper.sizeOfNullableBoolean(enableMetrics) + - BufferHelper.sizeOfNullableBoolean(defaultGroupRebalancePauseDispatch) + - SimpleString.sizeofNullableString(pageStoreName); + BufferHelper.sizeOfNullableBoolean(defaultGroupRebalancePauseDispatch); } @Override @@ -1530,7 +1510,6 @@ public class AddressSettings implements Mergeable, Serializable BufferHelper.writeNullableBoolean(buffer, defaultGroupRebalancePauseDispatch); - buffer.writeNullableSimpleString(pageStoreName); } /* (non-Javadoc) @@ -1602,7 +1581,6 @@ public class AddressSettings implements Mergeable, Serializable result = prime * result + ((expiryQueuePrefix == null) ? 0 : expiryQueuePrefix.hashCode()); result = prime * result + ((expiryQueueSuffix == null) ? 0 : expiryQueueSuffix.hashCode()); result = prime * result + ((enableMetrics == null) ? 0 : enableMetrics.hashCode()); - result = prime * result + ((pageStoreName == null) ? 0 : pageStoreName.hashCode()); return result; } @@ -1950,12 +1928,6 @@ public class AddressSettings implements Mergeable, Serializable } else if (!enableMetrics.equals(other.enableMetrics)) return false; - if (pageStoreName == null) { - if (other.pageStoreName != null) - return false; - } else if (!pageStoreName.equals(other.pageStoreName)) - return false; - return true; } @@ -2085,7 +2057,6 @@ public class AddressSettings implements Mergeable, Serializable expiryQueueSuffix + ", enableMetrics=" + enableMetrics + - ", pageAddress=" + pageStoreName + "]"; } } diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd index d03b466f8d..cb84282cdd 100644 --- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd +++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd @@ -3729,21 +3729,13 @@ - - - - - the name of the page store to use, to allow the page store to coalesce for address hierarchies when wildcard routing is in play - - - - pattern for matching settings against addresses; can use wildcards + pattern for matching settings against addresses; can use wildards 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 cab5752314..583b45045b 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 @@ -378,8 +378,6 @@ public class FileConfigurationTest extends ConfigurationImplTest { assertEquals(3, conf.getAddressesSettings().get("a1").getDefaultRingSize()); assertEquals(0, conf.getAddressesSettings().get("a1").getRetroactiveMessageCount()); assertTrue(conf.getAddressesSettings().get("a1").isEnableMetrics()); - assertNull("none fonfigured", conf.getAddressesSettings().get("a1").getPageStoreName()); - assertEquals(new SimpleString("a2.shared"), conf.getAddressesSettings().get("a2").getPageStoreName()); assertEquals("a2.1", conf.getAddressesSettings().get("a2").getDeadLetterAddress().toString()); assertEquals(true, conf.getAddressesSettings().get("a2").isAutoCreateDeadLetterResources()); diff --git a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml index 1075602851..0bde4f2d2c 100644 --- a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml +++ b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml @@ -481,7 +481,6 @@ 10000 10 false - a2.shared diff --git a/artemis-server/src/test/resources/ConfigurationTest-xinclude-config-address-settings.xml b/artemis-server/src/test/resources/ConfigurationTest-xinclude-config-address-settings.xml index 83267f31b6..5be0f08c01 100644 --- a/artemis-server/src/test/resources/ConfigurationTest-xinclude-config-address-settings.xml +++ b/artemis-server/src/test/resources/ConfigurationTest-xinclude-config-address-settings.xml @@ -78,6 +78,5 @@ 10000 10 false - a2.shared \ No newline at end of file diff --git a/docs/user-manual/en/address-model.md b/docs/user-manual/en/address-model.md index 369e6fdd1e..64e9acc02c 100644 --- a/docs/user-manual/en/address-model.md +++ b/docs/user-manual/en/address-model.md @@ -781,38 +781,6 @@ the client-side. If the value is `BLOCK` then client message producers will block when they try and send further messages. See the [Flow Control](flow-control.md) and [Paging](paging.md) chapters for more info. -`page-store-name` defines the name of the shared page store for matching addresses. -It is typically unused because the page store name maps to an address name by default. -However when addresses are hierarchical and subscriptions use -[wildcards](wildcard-routing.md), this setting is **required** to support [paging](paging.md). -Subscriptions assume a single page store for cursor management and resource usage -calculations. Using an explicitly configured `page-store-name` that will match the -root address of the hierarchy, paging can coalesce to a single page store and -the required assumptions will hold. - -For example, with a MULTICAST address hierarchy of: - - ticker.stock.us.apple - - ticker.stock.us.orange - - ticker.stock.eu.pear - - and with wildcard subscriptions on: - - ticker.stock.# - - ticker.stock.eu.# - - an address setting of: - - ```xml - - - ticker.stock.# - ... - ``` - will ensure that all paged messages coalesce into a single page store named `ticker.stock.#`. - The name does not need to be the same as the `match` attribute, it can be any string value. - What **is** important is that the `match` attribute captures the root of the hierarchy that will - support wildcards subscriptions. - - `message-counter-history-day-limit` is the number of days to keep message counter history for this address assuming that `message-counter-enabled` is `true`. Default is `0`. diff --git a/docs/user-manual/en/wildcard-routing.md b/docs/user-manual/en/wildcard-routing.md index 7fef8f3b3c..0db7748543 100644 --- a/docs/user-manual/en/wildcard-routing.md +++ b/docs/user-manual/en/wildcard-routing.md @@ -20,18 +20,5 @@ This functionality is enabled by default. To turn it off add the following to th ``` -## Paging with wild card addresses -Paging occurs at the address level and queue subscriptions access messages for an address through paging. -When wildcard routing is in play, it is normal for a queue to access multiple addresses and hence, potentially -multiple page stores. -To avoid the problems inherent in referencing multiple page stores, it is necessary to configure a wild card addresses -hierarchy with a single shared page store via an address setting called `page-store-name`. - -```xml - - news-wildcard - -``` - For more information on the wild card syntax and how to configure it, take a look at [wildcard syntax](wildcard-syntax.md) chapter, also see the topic hierarchy example in the [examples](examples.md). diff --git a/examples/features/standard/topic-hierarchies/pom.xml b/examples/features/standard/topic-hierarchies/pom.xml index f830461810..0079923e46 100644 --- a/examples/features/standard/topic-hierarchies/pom.xml +++ b/examples/features/standard/topic-hierarchies/pom.xml @@ -56,7 +56,10 @@ under the License. ${noServer} - ${basedir}/target/classes/activemq/server0 + + --addresses + news,news.usa,news.usa.wrestling,news.europe,news.europe.sport,news.europe.entertainment + diff --git a/examples/features/standard/topic-hierarchies/readme.md b/examples/features/standard/topic-hierarchies/readme.md index 9f3adc00ca..2f70bc719b 100644 --- a/examples/features/standard/topic-hierarchies/readme.md +++ b/examples/features/standard/topic-hierarchies/readme.md @@ -8,14 +8,4 @@ ActiveMQ Artemis wild-cards can use the character `#` which means "match any num For example if I subscribe using the wild-card `news.europe.#`, then that would match messages sent to the addresses `news.europe`, `news.europe.sport` and `news.europe.entertainment`, but it does not match messages sent to the address `news.usa.wrestling`. -Note that wildcard subscribers need some explicit configuration with respect to paging. The entire hierarchy needs to page to a single address such that subscribers don't race to store and account for individual messages. - -Notice the address setting in broker.xml that configures matching address (the root of the hierarchy) to use the shared "news-wildcard" page store. - -```xml - - news-wildcard - -``` - For more information on the wild-card syntax please consult the user manual. \ No newline at end of file diff --git a/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml deleted file mode 100644 index 32e69349d0..0000000000 --- a/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - ./data/bindings - - ./data/journal - - ./data/largemessages - - ./data/paging - - - - tcp://localhost:61616 - - - - - - - - - - - - - - - - - - - - - - news-wildcard - - - - -
-
-
-
-
-
- - - diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/WildcardTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/WildcardTest.java index 08b37d5de2..2bd8930b0e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/WildcardTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/WildcardTest.java @@ -16,9 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.jms.client; -import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.config.Configuration; -import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Assert; import org.junit.Test; @@ -55,7 +53,6 @@ public class WildcardTest extends JMSTestBase { @Override protected Configuration createDefaultConfig(boolean netty) throws Exception { Configuration configuration = super.createDefaultConfig(netty).setJMXManagementEnabled(true); - configuration.getAddressesSettings().put("test.#", new AddressSettings().setPageStoreName(new SimpleString("test-topic-hierarchy-root"))); return configuration; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttWildCardSubAutoCreateTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttWildCardSubAutoCreateTest.java index 99e4a5f414..ebbe1ddba8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttWildCardSubAutoCreateTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttWildCardSubAutoCreateTest.java @@ -70,8 +70,6 @@ public class MqttWildCardSubAutoCreateTest extends MQTTTestSupport { @Override protected ActiveMQServer createServer(final boolean realFiles, final Configuration configuration) { - configuration.getAddressesSettings().put("A.#", new AddressSettings().setPageSizeBytes(5).setMaxSizeBytes(10).setPageStoreName(new SimpleString("a-bag"))); - configuration.getAddressesSettings().put("news.#", new AddressSettings().setPageSizeBytes(5).setMaxSizeBytes(10).setPageStoreName(new SimpleString("news-bag"))); configuration.setGlobalMaxSize(15); return createServer(realFiles, configuration, AddressSettings.DEFAULT_PAGE_SIZE, 10); } @@ -227,7 +225,7 @@ public class MqttWildCardSubAutoCreateTest extends MQTTTestSupport { messageConsumerAllNews.close(); int countOfPageStores = server.getPagingManager().getStoreNames().length; - assertEquals("there should only be one", 1, countOfPageStores); + assertEquals("there should be 5", 5, countOfPageStores); connection.close(); @@ -240,26 +238,4 @@ public class MqttWildCardSubAutoCreateTest extends MQTTTestSupport { private void addSizeProp(TextMessage messageWrestlingNews) throws JMSException { messageWrestlingNews.setStringProperty("stuff", new String(new byte[1024])); } - - - @Test - public void testWarnOnWildcardWithNoMatchingPageStoreName() throws Exception { - - try { - AssertionLoggerHandler.startCapture(); - - ConnectionFactory cf = new ActiveMQConnectionFactory(); - Connection connection = cf.createConnection(); - connection.setClientID("some-sensible-identity"); - connection.start(); - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - MessageConsumer messageConsumer = session.createDurableConsumer(session.createTopic("b.c.#"), "w-a-warn"); - messageConsumer.close(); - - connection.close(); - Assert.assertTrue(AssertionLoggerHandler.findText("222295")); - } finally { - AssertionLoggerHandler.stopCapture(); - } - } } \ No newline at end of file diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSizeWildcardTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSizeWildcardTest.java index a1e64c60c3..711a8cebfc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSizeWildcardTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSizeWildcardTest.java @@ -29,7 +29,6 @@ import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.api.jms.JMSFactoryType; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Test; @@ -40,7 +39,6 @@ public class PagingSizeWildcardTest extends ActiveMQTestBase { public void testWildcardPageSize() throws Exception { Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false); - config.getAddressesSettings().put("A.#", new AddressSettings().setPageStoreName(new SimpleString("shared-page-store-for-a#"))); ActiveMQServer server = createServer(true, config, 200, 400); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index 644adff791..bbf96abc61 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -6591,92 +6591,6 @@ public class PagingTest extends ActiveMQTestBase { server.stop(); } - @Test - public void testHierarchicalPagingStoreNotDestroyed() throws Exception { - clearDataRecreateServerDirs(); - - final SimpleString pageAddress = new SimpleString("A.#"); - Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false); - config.getAddressesSettings().put("A.#", new AddressSettings().setPageStoreName(pageAddress)); - - server = createServer(true, config, 100, 500); - - server.start(); - - final int numberOfMessages = 10; - final int messageSize = 100; - - locator = createInVMNonHALocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true); - - sf = createSessionFactory(locator); - - ClientSession session = sf.createSession(false, false, false); - - final SimpleString addressA = new SimpleString("A.a.#"); - session.createQueue(new QueueConfiguration(addressA)); - - final SimpleString addressB = new SimpleString("A.b.#"); - session.createQueue(new QueueConfiguration(addressB)); - - final SimpleString produceAddressA = new SimpleString("A.a.a"); - ClientProducer producerA = session.createProducer(produceAddressA); - - final SimpleString produceAddressB = new SimpleString("A.b.a"); - ClientProducer producerB = session.createProducer(produceAddressB); - - ClientMessage message = null; - - byte[] body = new byte[messageSize]; - - ByteBuffer bb = ByteBuffer.wrap(body); - - for (int j = 1; j <= messageSize; j++) { - bb.put(getSamplebyte(j)); - } - - for (int i = 0; i < numberOfMessages; i++) { - message = session.createMessage(true); - - ActiveMQBuffer bodyLocal = message.getBodyBuffer(); - - bodyLocal.writeBytes(body); - - producerA.send(message); - producerB.send(message); - session.commit(); - } - session.commit(); - producerA.close(); - producerB.close(); - - assertTrue(Arrays.asList(server.getPagingManager().getStoreNames()).contains(pageAddress)); - assertTrue(server.getPagingManager().getPageStore(pageAddress).isPaging()); - - session.deleteQueue(addressA); - session.deleteQueue(addressB); - - session.close(); - - System.err.println("storeNames: " + Arrays.asList(server.getPagingManager().getStoreNames())); - - server.getPagingManager().deletePageStore(produceAddressA); - server.getPagingManager().deletePageStore(produceAddressB); - - sf.close(); - locator.close(); - locator = null; - sf = null; - assertTrue(Arrays.asList(server.getPagingManager().getStoreNames()).contains(pageAddress)); - // Ensure wildcard store is still there - server.getPagingManager().reloadStores(); - assertTrue(Arrays.asList(server.getPagingManager().getStoreNames()).contains(pageAddress)); - server.stop(); - - server.start(); - assertTrue(Arrays.asList(server.getPagingManager().getStoreNames()).contains(pageAddress)); - server.stop(); - } - @Test public void testStopPagingWithoutConsumersIfTwoPages() throws Exception { testStopPagingWithoutConsumersOnOneQueue(true);