ARTEMIS-3835 - deprecate addressesSettings in place of addressSettings on the Configuration bean
This commit is contained in:
parent
168b61ec38
commit
b390a6b08f
|
@ -85,7 +85,7 @@ public class EmbeddedActiveMQResource extends ExternalResource {
|
|||
* Create a default EmbeddedActiveMQResource
|
||||
*/
|
||||
public EmbeddedActiveMQResource() {
|
||||
configuration = new ConfigurationImpl().setName(SERVER_NAME).setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("dla")).setExpiryAddress(SimpleString.toSimpleString("expiry")));
|
||||
configuration = new ConfigurationImpl().setName(SERVER_NAME).setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addAddressSetting("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("dla")).setExpiryAddress(SimpleString.toSimpleString("expiry")));
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
|
@ -1088,16 +1088,28 @@ public interface Configuration {
|
|||
/**
|
||||
* @return A list of AddressSettings per matching to be deployed to the address settings repository
|
||||
*/
|
||||
Map<String, AddressSettings> getAddressesSettings();
|
||||
Map<String, AddressSettings> getAddressSettings();
|
||||
|
||||
/**
|
||||
* @param addressesSettings list of AddressSettings per matching to be deployed to the address
|
||||
* @param addressSettings list of AddressSettings per matching to be deployed to the address
|
||||
* settings repository
|
||||
*/
|
||||
Configuration setAddressSettings(Map<String, AddressSettings> addressSettings);
|
||||
|
||||
Configuration addAddressSetting(String key, AddressSettings addressesSetting);
|
||||
|
||||
Configuration clearAddressSettings();
|
||||
|
||||
@Deprecated
|
||||
Map<String, AddressSettings> getAddressesSettings();
|
||||
|
||||
@Deprecated
|
||||
Configuration setAddressesSettings(Map<String, AddressSettings> addressesSettings);
|
||||
|
||||
@Deprecated
|
||||
Configuration addAddressesSetting(String key, AddressSettings addressesSetting);
|
||||
|
||||
@Deprecated
|
||||
Configuration clearAddressesSettings();
|
||||
|
||||
/**
|
||||
|
|
|
@ -299,7 +299,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
|
|||
|
||||
protected GroupingHandlerConfiguration groupingHandlerConfiguration;
|
||||
|
||||
private Map<String, AddressSettings> addressesSettings = new HashMap<>();
|
||||
private Map<String, AddressSettings> addressSettings = new HashMap<>();
|
||||
|
||||
private Map<String, ResourceLimitSettings> resourceLimitSettings = new HashMap<>();
|
||||
|
||||
|
@ -1646,26 +1646,50 @@ public class ConfigurationImpl implements Configuration, Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, AddressSettings> getAddressSettings() {
|
||||
return addressSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationImpl setAddressSettings(final Map<String, AddressSettings> addressesSettings) {
|
||||
this.addressSettings = addressesSettings;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationImpl addAddressSetting(String key, AddressSettings addressesSetting) {
|
||||
this.addressSettings.put(key, addressesSetting);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationImpl clearAddressSettings() {
|
||||
this.addressSettings.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public Map<String, AddressSettings> getAddressesSettings() {
|
||||
return addressesSettings;
|
||||
return getAddressSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ConfigurationImpl setAddressesSettings(final Map<String, AddressSettings> addressesSettings) {
|
||||
this.addressesSettings = addressesSettings;
|
||||
return this;
|
||||
return setAddressSettings(addressesSettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ConfigurationImpl addAddressesSetting(String key, AddressSettings addressesSetting) {
|
||||
this.addressesSettings.put(key, addressesSetting);
|
||||
return this;
|
||||
return addAddressSetting(key, addressesSetting);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ConfigurationImpl clearAddressesSettings() {
|
||||
this.addressesSettings.clear();
|
||||
return this;
|
||||
return clearAddressSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2128,7 +2152,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
|
|||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((acceptorConfigs == null) ? 0 : acceptorConfigs.hashCode());
|
||||
result = prime * result + ((addressesSettings == null) ? 0 : addressesSettings.hashCode());
|
||||
result = prime * result + ((addressSettings == null) ? 0 : addressSettings.hashCode());
|
||||
result = prime * result + (asyncConnectionExecutionEnabled ? 1231 : 1237);
|
||||
result = prime * result + ((bindingsDirectory == null) ? 0 : bindingsDirectory.hashCode());
|
||||
result = prime * result + ((bridgeConfigurations == null) ? 0 : bridgeConfigurations.hashCode());
|
||||
|
@ -2214,10 +2238,10 @@ public class ConfigurationImpl implements Configuration, Serializable {
|
|||
return false;
|
||||
} else if (!acceptorConfigs.equals(other.acceptorConfigs))
|
||||
return false;
|
||||
if (addressesSettings == null) {
|
||||
if (other.addressesSettings != null)
|
||||
if (addressSettings == null) {
|
||||
if (other.addressSettings != null)
|
||||
return false;
|
||||
} else if (!addressesSettings.equals(other.addressesSettings))
|
||||
} else if (!addressSettings.equals(other.addressSettings))
|
||||
return false;
|
||||
if (asyncConnectionExecutionEnabled != other.asyncConnectionExecutionEnabled)
|
||||
return false;
|
||||
|
|
|
@ -1036,11 +1036,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
NodeList list = node.getElementsByTagName("address-setting");
|
||||
for (int i = 0; i < list.getLength(); i++) {
|
||||
Pair<String, AddressSettings> newAddressSettings = parseAddressSettings(list.item(i));
|
||||
Map<String, AddressSettings> addressSettings = config.getAddressesSettings();
|
||||
Map<String, AddressSettings> addressSettings = config.getAddressSettings();
|
||||
if (addressSettings.containsKey(newAddressSettings.getA())) {
|
||||
ActiveMQServerLogger.LOGGER.duplicateAddressSettingMatch(newAddressSettings.getA());
|
||||
} else {
|
||||
config.getAddressesSettings().put(newAddressSettings.getA(), newAddressSettings.getB());
|
||||
config.getAddressSettings().put(newAddressSettings.getA(), newAddressSettings.getB());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3567,7 +3567,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
}
|
||||
|
||||
private void deployAddressSettingsFromConfiguration() {
|
||||
for (Map.Entry<String, AddressSettings> entry : configuration.getAddressesSettings().entrySet()) {
|
||||
for (Map.Entry<String, AddressSettings> entry : configuration.getAddressSettings().entrySet()) {
|
||||
addressSettingsRepository.addMatch(entry.getKey(), entry.getValue(), true);
|
||||
}
|
||||
}
|
||||
|
@ -4344,7 +4344,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
LegacyJMSConfiguration legacyJMSConfiguration = new LegacyJMSConfiguration(config);
|
||||
legacyJMSConfiguration.parseConfiguration(uri.openStream());
|
||||
configuration.setSecurityRoles(config.getSecurityRoles());
|
||||
configuration.setAddressesSettings(config.getAddressesSettings());
|
||||
configuration.setAddressSettings(config.getAddressSettings());
|
||||
configuration.setDivertConfigurations(config.getDivertConfigurations());
|
||||
configuration.setAddressConfigurations(config.getAddressConfigurations());
|
||||
configuration.setQueueConfigs(config.getQueueConfigs());
|
||||
|
@ -4390,7 +4390,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
recoverStoredSecuritySettings();
|
||||
|
||||
ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings");
|
||||
addressSettingsRepository.swap(configuration.getAddressesSettings().entrySet());
|
||||
addressSettingsRepository.swap(configuration.getAddressSettings().entrySet());
|
||||
recoverStoredAddressSettings();
|
||||
|
||||
ActiveMQServerLogger.LOGGER.reloadingConfiguration("diverts");
|
||||
|
|
|
@ -747,16 +747,16 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
|
|||
|
||||
Properties properties = new Properties();
|
||||
|
||||
properties.put("addressesSettings.#.expiryAddress", "sharedExpiry");
|
||||
properties.put("addressesSettings.NeedToTrackExpired.expiryAddress", "important");
|
||||
properties.put("addressesSettings.\"Name.With.Dots\".expiryAddress", "moreImportant");
|
||||
properties.put("addressesSettings.#.expiryAddress", "sharedExpiry"); // verify @Deprecation double plural still works
|
||||
properties.put("addressSettings.NeedToTrackExpired.expiryAddress", "important");
|
||||
properties.put("addressSettings.\"Name.With.Dots\".expiryAddress", "moreImportant");
|
||||
|
||||
configuration.parsePrefixedProperties(properties, null);
|
||||
|
||||
Assert.assertEquals(3, configuration.getAddressesSettings().size());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("sharedExpiry"), configuration.getAddressesSettings().get("#").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("important"), configuration.getAddressesSettings().get("NeedToTrackExpired").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("moreImportant"), configuration.getAddressesSettings().get("Name.With.Dots").getExpiryAddress());
|
||||
Assert.assertEquals(3, configuration.getAddressSettings().size());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("sharedExpiry"), configuration.getAddressSettings().get("#").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("important"), configuration.getAddressSettings().get("NeedToTrackExpired").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("moreImportant"), configuration.getAddressSettings().get("Name.With.Dots").getExpiryAddress());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -929,10 +929,10 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
|
|||
|
||||
configuration.parsePrefixedProperties(properties, null);
|
||||
|
||||
Assert.assertEquals(3, configuration.getAddressesSettings().size());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("sharedExpiry"), configuration.getAddressesSettings().get("#").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("important"), configuration.getAddressesSettings().get("NeedToTrackExpired").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("moreImportant"), configuration.getAddressesSettings().get("Name.With.Dots").getExpiryAddress());
|
||||
Assert.assertEquals(3, configuration.getAddressSettings().size());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("sharedExpiry"), configuration.getAddressSettings().get("#").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("important"), configuration.getAddressSettings().get("NeedToTrackExpired").getExpiryAddress());
|
||||
Assert.assertEquals(SimpleString.toSimpleString("moreImportant"), configuration.getAddressSettings().get("Name.With.Dots").getExpiryAddress());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -101,7 +101,7 @@ public class FileConfigurationParserTest extends ActiveMQTestBase {
|
|||
FileConfigurationParser parser = new FileConfigurationParser();
|
||||
Configuration config = parser.parseMainConfig(ClassloadingUtil.findResource("FileConfigurationParser-duplicateAddressSettings.xml").openStream());
|
||||
|
||||
Assert.assertEquals(123, config.getAddressesSettings().get("foo").getRedistributionDelay());
|
||||
Assert.assertEquals(123, config.getAddressSettings().get("foo").getRedistributionDelay());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -365,7 +365,7 @@ public class FileConfigurationParserTest extends ActiveMQTestBase {
|
|||
ByteArrayInputStream input = new ByteArrayInputStream(configStr.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
Configuration configuration = parser.parseMainConfig(input);
|
||||
AddressSettings settings = configuration.getAddressesSettings().get("foo");
|
||||
AddressSettings settings = configuration.getAddressSettings().get("foo");
|
||||
Assert.assertEquals(123, settings.getMaxSizeMessages());
|
||||
}
|
||||
|
||||
|
@ -414,8 +414,8 @@ public class FileConfigurationParserTest extends ActiveMQTestBase {
|
|||
+ "\n") + lastPart;
|
||||
ByteArrayInputStream input = new ByteArrayInputStream(configStr.getBytes(StandardCharsets.UTF_8));
|
||||
Configuration configuration = new FileConfigurationParser().parseMainConfig(input);
|
||||
assertEquals(1, configuration.getAddressesSettings().size());
|
||||
AddressSettings addressSettings = configuration.getAddressesSettings().get("#");
|
||||
assertEquals(1, configuration.getAddressSettings().size());
|
||||
AddressSettings addressSettings = configuration.getAddressSettings().get("#");
|
||||
assertEquals(expected, addressSettings.getMaxSizeBytesRejectThreshold());
|
||||
}
|
||||
|
||||
|
|
|
@ -402,83 +402,83 @@ public class FileConfigurationTest extends ConfigurationImplTest {
|
|||
}
|
||||
}
|
||||
|
||||
assertEquals(2, conf.getAddressesSettings().size());
|
||||
assertEquals(2, conf.getAddressSettings().size());
|
||||
|
||||
assertTrue(conf.getAddressesSettings().get("a1") != null);
|
||||
assertTrue(conf.getAddressesSettings().get("a2") != null);
|
||||
assertTrue(conf.getAddressSettings().get("a1") != null);
|
||||
assertTrue(conf.getAddressSettings().get("a2") != null);
|
||||
|
||||
assertEquals("a1.1", conf.getAddressesSettings().get("a1").getDeadLetterAddress().toString());
|
||||
assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_DEAD_LETTER_RESOURCES, conf.getAddressesSettings().get("a1").isAutoCreateDeadLetterResources());
|
||||
assertEquals(AddressSettings.DEFAULT_DEAD_LETTER_QUEUE_PREFIX, conf.getAddressesSettings().get("a1").getDeadLetterQueuePrefix());
|
||||
assertEquals(AddressSettings.DEFAULT_DEAD_LETTER_QUEUE_SUFFIX, conf.getAddressesSettings().get("a1").getDeadLetterQueueSuffix());
|
||||
assertEquals("a1.2", conf.getAddressesSettings().get("a1").getExpiryAddress().toString());
|
||||
assertEquals(1L, (long) conf.getAddressesSettings().get("a1").getExpiryDelay());
|
||||
assertEquals(2L, (long) conf.getAddressesSettings().get("a1").getMinExpiryDelay());
|
||||
assertEquals(3L, (long) conf.getAddressesSettings().get("a1").getMaxExpiryDelay());
|
||||
assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_EXPIRY_RESOURCES, conf.getAddressesSettings().get("a1").isAutoCreateExpiryResources());
|
||||
assertEquals(AddressSettings.DEFAULT_EXPIRY_QUEUE_PREFIX, conf.getAddressesSettings().get("a1").getExpiryQueuePrefix());
|
||||
assertEquals(AddressSettings.DEFAULT_EXPIRY_QUEUE_SUFFIX, conf.getAddressesSettings().get("a1").getExpiryQueueSuffix());
|
||||
assertEquals(1, conf.getAddressesSettings().get("a1").getRedeliveryDelay());
|
||||
assertEquals(0.5, conf.getAddressesSettings().get("a1").getRedeliveryCollisionAvoidanceFactor(), 0);
|
||||
assertEquals(856686592L, conf.getAddressesSettings().get("a1").getMaxSizeBytes());
|
||||
assertEquals(817381738L, conf.getAddressesSettings().get("a1").getPageSizeBytes());
|
||||
assertEquals(10, conf.getAddressesSettings().get("a1").getPageCacheMaxSize());
|
||||
assertEquals(4, conf.getAddressesSettings().get("a1").getMessageCounterHistoryDayLimit());
|
||||
assertEquals(10, conf.getAddressesSettings().get("a1").getSlowConsumerThreshold());
|
||||
assertEquals(SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_HOUR, conf.getAddressesSettings().get("a1").getSlowConsumerThresholdMeasurementUnit());
|
||||
assertEquals(5, conf.getAddressesSettings().get("a1").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.NOTIFY, conf.getAddressesSettings().get("a1").getSlowConsumerPolicy());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsQueues());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsQueues());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsTopics());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsTopics());
|
||||
assertEquals(0, conf.getAddressesSettings().get("a1").getAutoDeleteQueuesDelay());
|
||||
assertEquals(0, conf.getAddressesSettings().get("a1").getAutoDeleteAddressesDelay());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a1").isDefaultPurgeOnNoConsumers());
|
||||
assertEquals(5, conf.getAddressesSettings().get("a1").getDefaultMaxConsumers());
|
||||
assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a1").getDefaultQueueRoutingType());
|
||||
assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a1").getDefaultAddressRoutingType());
|
||||
assertEquals(3, conf.getAddressesSettings().get("a1").getDefaultRingSize());
|
||||
assertEquals(0, conf.getAddressesSettings().get("a1").getRetroactiveMessageCount());
|
||||
assertTrue(conf.getAddressesSettings().get("a1").isEnableMetrics());
|
||||
assertTrue(conf.getAddressesSettings().get("a1").isEnableIngressTimestamp());
|
||||
assertEquals("a1.1", conf.getAddressSettings().get("a1").getDeadLetterAddress().toString());
|
||||
assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_DEAD_LETTER_RESOURCES, conf.getAddressSettings().get("a1").isAutoCreateDeadLetterResources());
|
||||
assertEquals(AddressSettings.DEFAULT_DEAD_LETTER_QUEUE_PREFIX, conf.getAddressSettings().get("a1").getDeadLetterQueuePrefix());
|
||||
assertEquals(AddressSettings.DEFAULT_DEAD_LETTER_QUEUE_SUFFIX, conf.getAddressSettings().get("a1").getDeadLetterQueueSuffix());
|
||||
assertEquals("a1.2", conf.getAddressSettings().get("a1").getExpiryAddress().toString());
|
||||
assertEquals(1L, (long) conf.getAddressSettings().get("a1").getExpiryDelay());
|
||||
assertEquals(2L, (long) conf.getAddressSettings().get("a1").getMinExpiryDelay());
|
||||
assertEquals(3L, (long) conf.getAddressSettings().get("a1").getMaxExpiryDelay());
|
||||
assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_EXPIRY_RESOURCES, conf.getAddressSettings().get("a1").isAutoCreateExpiryResources());
|
||||
assertEquals(AddressSettings.DEFAULT_EXPIRY_QUEUE_PREFIX, conf.getAddressSettings().get("a1").getExpiryQueuePrefix());
|
||||
assertEquals(AddressSettings.DEFAULT_EXPIRY_QUEUE_SUFFIX, conf.getAddressSettings().get("a1").getExpiryQueueSuffix());
|
||||
assertEquals(1, conf.getAddressSettings().get("a1").getRedeliveryDelay());
|
||||
assertEquals(0.5, conf.getAddressSettings().get("a1").getRedeliveryCollisionAvoidanceFactor(), 0);
|
||||
assertEquals(856686592L, conf.getAddressSettings().get("a1").getMaxSizeBytes());
|
||||
assertEquals(817381738L, conf.getAddressSettings().get("a1").getPageSizeBytes());
|
||||
assertEquals(10, conf.getAddressSettings().get("a1").getPageCacheMaxSize());
|
||||
assertEquals(4, conf.getAddressSettings().get("a1").getMessageCounterHistoryDayLimit());
|
||||
assertEquals(10, conf.getAddressSettings().get("a1").getSlowConsumerThreshold());
|
||||
assertEquals(SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_HOUR, conf.getAddressSettings().get("a1").getSlowConsumerThresholdMeasurementUnit());
|
||||
assertEquals(5, conf.getAddressSettings().get("a1").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.NOTIFY, conf.getAddressSettings().get("a1").getSlowConsumerPolicy());
|
||||
assertEquals(true, conf.getAddressSettings().get("a1").isAutoCreateJmsQueues());
|
||||
assertEquals(true, conf.getAddressSettings().get("a1").isAutoDeleteJmsQueues());
|
||||
assertEquals(true, conf.getAddressSettings().get("a1").isAutoCreateJmsTopics());
|
||||
assertEquals(true, conf.getAddressSettings().get("a1").isAutoDeleteJmsTopics());
|
||||
assertEquals(0, conf.getAddressSettings().get("a1").getAutoDeleteQueuesDelay());
|
||||
assertEquals(0, conf.getAddressSettings().get("a1").getAutoDeleteAddressesDelay());
|
||||
assertEquals(false, conf.getAddressSettings().get("a1").isDefaultPurgeOnNoConsumers());
|
||||
assertEquals(5, conf.getAddressSettings().get("a1").getDefaultMaxConsumers());
|
||||
assertEquals(RoutingType.ANYCAST, conf.getAddressSettings().get("a1").getDefaultQueueRoutingType());
|
||||
assertEquals(RoutingType.MULTICAST, conf.getAddressSettings().get("a1").getDefaultAddressRoutingType());
|
||||
assertEquals(3, conf.getAddressSettings().get("a1").getDefaultRingSize());
|
||||
assertEquals(0, conf.getAddressSettings().get("a1").getRetroactiveMessageCount());
|
||||
assertTrue(conf.getAddressSettings().get("a1").isEnableMetrics());
|
||||
assertTrue(conf.getAddressSettings().get("a1").isEnableIngressTimestamp());
|
||||
|
||||
assertEquals("a2.1", conf.getAddressesSettings().get("a2").getDeadLetterAddress().toString());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a2").isAutoCreateDeadLetterResources());
|
||||
assertEquals("", conf.getAddressesSettings().get("a2").getDeadLetterQueuePrefix().toString());
|
||||
assertEquals(".DLQ", conf.getAddressesSettings().get("a2").getDeadLetterQueueSuffix().toString());
|
||||
assertEquals("a2.2", conf.getAddressesSettings().get("a2").getExpiryAddress().toString());
|
||||
assertEquals(-1L, (long) conf.getAddressesSettings().get("a2").getExpiryDelay());
|
||||
assertEquals(-1L, (long) conf.getAddressesSettings().get("a2").getMinExpiryDelay());
|
||||
assertEquals(-1L, (long) conf.getAddressesSettings().get("a2").getMaxExpiryDelay());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a2").isAutoCreateDeadLetterResources());
|
||||
assertEquals("", conf.getAddressesSettings().get("a2").getExpiryQueuePrefix().toString());
|
||||
assertEquals(".EXP", conf.getAddressesSettings().get("a2").getExpiryQueueSuffix().toString());
|
||||
assertEquals(5, conf.getAddressesSettings().get("a2").getRedeliveryDelay());
|
||||
assertEquals(0.0, conf.getAddressesSettings().get("a2").getRedeliveryCollisionAvoidanceFactor(), 0);
|
||||
assertEquals(932489234928324L, conf.getAddressesSettings().get("a2").getMaxSizeBytes());
|
||||
assertEquals(712671626L, conf.getAddressesSettings().get("a2").getPageSizeBytes());
|
||||
assertEquals(20, conf.getAddressesSettings().get("a2").getPageCacheMaxSize());
|
||||
assertEquals(8, conf.getAddressesSettings().get("a2").getMessageCounterHistoryDayLimit());
|
||||
assertEquals(20, conf.getAddressesSettings().get("a2").getSlowConsumerThreshold());
|
||||
assertEquals(SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_DAY, conf.getAddressesSettings().get("a2").getSlowConsumerThresholdMeasurementUnit());
|
||||
assertEquals(15, conf.getAddressesSettings().get("a2").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.KILL, conf.getAddressesSettings().get("a2").getSlowConsumerPolicy());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsQueues());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsQueues());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsTopics());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsTopics());
|
||||
assertEquals(500, conf.getAddressesSettings().get("a2").getAutoDeleteQueuesDelay());
|
||||
assertEquals(1000, conf.getAddressesSettings().get("a2").getAutoDeleteAddressesDelay());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a2").isDefaultPurgeOnNoConsumers());
|
||||
assertEquals(15, conf.getAddressesSettings().get("a2").getDefaultMaxConsumers());
|
||||
assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a2").getDefaultQueueRoutingType());
|
||||
assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a2").getDefaultAddressRoutingType());
|
||||
assertEquals(10000, conf.getAddressesSettings().get("a2").getDefaultConsumerWindowSize());
|
||||
assertEquals(-1, conf.getAddressesSettings().get("a2").getDefaultRingSize());
|
||||
assertEquals(10, conf.getAddressesSettings().get("a2").getRetroactiveMessageCount());
|
||||
assertFalse(conf.getAddressesSettings().get("a2").isEnableMetrics());
|
||||
assertFalse(conf.getAddressesSettings().get("a2").isEnableIngressTimestamp());
|
||||
assertEquals("a2.1", conf.getAddressSettings().get("a2").getDeadLetterAddress().toString());
|
||||
assertEquals(true, conf.getAddressSettings().get("a2").isAutoCreateDeadLetterResources());
|
||||
assertEquals("", conf.getAddressSettings().get("a2").getDeadLetterQueuePrefix().toString());
|
||||
assertEquals(".DLQ", conf.getAddressSettings().get("a2").getDeadLetterQueueSuffix().toString());
|
||||
assertEquals("a2.2", conf.getAddressSettings().get("a2").getExpiryAddress().toString());
|
||||
assertEquals(-1L, (long) conf.getAddressSettings().get("a2").getExpiryDelay());
|
||||
assertEquals(-1L, (long) conf.getAddressSettings().get("a2").getMinExpiryDelay());
|
||||
assertEquals(-1L, (long) conf.getAddressSettings().get("a2").getMaxExpiryDelay());
|
||||
assertEquals(true, conf.getAddressSettings().get("a2").isAutoCreateDeadLetterResources());
|
||||
assertEquals("", conf.getAddressSettings().get("a2").getExpiryQueuePrefix().toString());
|
||||
assertEquals(".EXP", conf.getAddressSettings().get("a2").getExpiryQueueSuffix().toString());
|
||||
assertEquals(5, conf.getAddressSettings().get("a2").getRedeliveryDelay());
|
||||
assertEquals(0.0, conf.getAddressSettings().get("a2").getRedeliveryCollisionAvoidanceFactor(), 0);
|
||||
assertEquals(932489234928324L, conf.getAddressSettings().get("a2").getMaxSizeBytes());
|
||||
assertEquals(712671626L, conf.getAddressSettings().get("a2").getPageSizeBytes());
|
||||
assertEquals(20, conf.getAddressSettings().get("a2").getPageCacheMaxSize());
|
||||
assertEquals(8, conf.getAddressSettings().get("a2").getMessageCounterHistoryDayLimit());
|
||||
assertEquals(20, conf.getAddressSettings().get("a2").getSlowConsumerThreshold());
|
||||
assertEquals(SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_DAY, conf.getAddressSettings().get("a2").getSlowConsumerThresholdMeasurementUnit());
|
||||
assertEquals(15, conf.getAddressSettings().get("a2").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.KILL, conf.getAddressSettings().get("a2").getSlowConsumerPolicy());
|
||||
assertEquals(false, conf.getAddressSettings().get("a2").isAutoCreateJmsQueues());
|
||||
assertEquals(false, conf.getAddressSettings().get("a2").isAutoDeleteJmsQueues());
|
||||
assertEquals(false, conf.getAddressSettings().get("a2").isAutoCreateJmsTopics());
|
||||
assertEquals(false, conf.getAddressSettings().get("a2").isAutoDeleteJmsTopics());
|
||||
assertEquals(500, conf.getAddressSettings().get("a2").getAutoDeleteQueuesDelay());
|
||||
assertEquals(1000, conf.getAddressSettings().get("a2").getAutoDeleteAddressesDelay());
|
||||
assertEquals(true, conf.getAddressSettings().get("a2").isDefaultPurgeOnNoConsumers());
|
||||
assertEquals(15, conf.getAddressSettings().get("a2").getDefaultMaxConsumers());
|
||||
assertEquals(RoutingType.MULTICAST, conf.getAddressSettings().get("a2").getDefaultQueueRoutingType());
|
||||
assertEquals(RoutingType.ANYCAST, conf.getAddressSettings().get("a2").getDefaultAddressRoutingType());
|
||||
assertEquals(10000, conf.getAddressSettings().get("a2").getDefaultConsumerWindowSize());
|
||||
assertEquals(-1, conf.getAddressSettings().get("a2").getDefaultRingSize());
|
||||
assertEquals(10, conf.getAddressSettings().get("a2").getRetroactiveMessageCount());
|
||||
assertFalse(conf.getAddressSettings().get("a2").isEnableMetrics());
|
||||
assertFalse(conf.getAddressSettings().get("a2").isEnableIngressTimestamp());
|
||||
|
||||
assertTrue(conf.getResourceLimitSettings().containsKey("myUser"));
|
||||
assertEquals(104, conf.getResourceLimitSettings().get("myUser").getMaxConnections());
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
|
|||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
|
||||
import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS
|
||||
import org.apache.activemq.artemis.tests.compatibility.GroovyRun;
|
||||
|
||||
|
||||
String folder = arg[0];
|
||||
|
@ -36,9 +35,9 @@ configuration.setBrokerInstance(new File(folder + "/" + id));
|
|||
configuration.addAcceptorConfiguration("artemis", "tcp://0.0.0.0:61616?anycastPrefix=jms.queue.&multicastPrefix=jms.topic.");
|
||||
configuration.setSecurityEnabled(false);
|
||||
configuration.setPersistenceEnabled(false);
|
||||
configuration.addAddressesSetting("myQueue", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setMaxSizeBytes(1024 * 1024 * 1024).setPageSizeBytes(1024));
|
||||
configuration.addAddressSetting("myQueue", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setMaxSizeBytes(1024 * 1024 * 1024).setPageSizeBytes(1024));
|
||||
// if the client is using the wrong address, it will wrongly block
|
||||
configuration.addAddressesSetting("#", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK).setMaxSizeBytes(10 * 1024).setPageSizeBytes(1024));
|
||||
configuration.addAddressSetting("#", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK).setMaxSizeBytes(10 * 1024).setPageSizeBytes(1024));
|
||||
jmsConfiguration = new JMSConfigurationImpl();
|
||||
|
||||
// used here even though it's deprecated to be compatible with older versions of the broker
|
||||
|
|
|
@ -39,7 +39,7 @@ configuration.setSecurityEnabled(false);
|
|||
configuration.setPersistenceEnabled(persistent);
|
||||
try {
|
||||
if (!type.startsWith("ARTEMIS-1")) {
|
||||
configuration.addAddressesSetting("#", new AddressSettings().setAutoCreateAddresses(true));
|
||||
configuration.addAddressSetting("#", new AddressSettings().setAutoCreateAddresses(true));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// need to ignore this for 1.4
|
||||
|
|
|
@ -3,7 +3,6 @@ package servers
|
|||
import org.apache.activemq.artemis.api.core.RoutingType
|
||||
import org.apache.activemq.artemis.api.core.SimpleString
|
||||
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl
|
||||
import org.apache.activemq.artemis.core.postoffice.impl.AddressImpl
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -45,10 +44,10 @@ configuration.setSecurityEnabled(false);
|
|||
configuration.setPersistenceEnabled(true);
|
||||
try {
|
||||
if (!type.startsWith("ARTEMIS-1")) {
|
||||
configuration.addAddressesSetting("#", new AddressSettings().setAutoCreateAddresses(false).setDeadLetterAddress(SimpleString.toSimpleString("DLQ"))
|
||||
configuration.addAddressSetting("#", new AddressSettings().setAutoCreateAddresses(false).setDeadLetterAddress(SimpleString.toSimpleString("DLQ"))
|
||||
.setExpiryAddress(SimpleString.toSimpleString("EXP")));
|
||||
if (globalMaxSize != null) {
|
||||
configuration.getAddressesSettings().get("#").setPageSizeBytes(Long.parseLong(globalMaxSize)).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
|
||||
configuration.getAddressSettings().get("#").setPageSizeBytes(Long.parseLong(globalMaxSize)).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
|
||||
configuration.setGlobalMaxSize(Long.parseLong(globalMaxSize));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ if (!(type.startsWith("ARTEMIS-1") || type.startsWith("HORNETQ"))) {
|
|||
addressSettings.setAutoCreateAddresses(false);
|
||||
addressSettings.setAutoCreateQueues(false);
|
||||
}
|
||||
configuration.addAddressesSetting("#", addressSettings);
|
||||
configuration.addAddressSetting("#", addressSettings);
|
||||
|
||||
addressSettings = new AddressSettings();
|
||||
addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
|
||||
|
@ -68,7 +68,7 @@ if (!(type.startsWith("ARTEMIS-1") || type.startsWith("HORNETQ"))) {
|
|||
addressSettings.setAutoCreateAddresses(false);
|
||||
addressSettings.setAutoCreateQueues(false);
|
||||
}
|
||||
configuration.addAddressesSetting("jms.#", addressSettings);
|
||||
configuration.addAddressSetting("jms.#", addressSettings);
|
||||
|
||||
// if the client is using the wrong address, it will wrongly block
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ configuration.setSecurityEnabled(false);
|
|||
configuration.setPersistenceEnabled(persistent);
|
||||
try {
|
||||
if (!type.startsWith("ARTEMIS-1")) {
|
||||
configuration.addAddressesSetting("#", new AddressSettings().setAutoCreateAddresses(true));
|
||||
configuration.addAddressSetting("#", new AddressSettings().setAutoCreateAddresses(true));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// need to ignore this for 1.4
|
||||
|
|
|
@ -59,7 +59,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport {
|
|||
autoCreateQueueAddressSettings.setDefaultAddressRoutingType(RoutingType.ANYCAST);
|
||||
autoCreateQueueAddressSettings.setDefaultQueueRoutingType(RoutingType.ANYCAST);
|
||||
|
||||
server.getConfiguration().getAddressesSettings().put(AUTO_CREATION_QUEUE_PREFIX + "#", autoCreateQueueAddressSettings);
|
||||
server.getConfiguration().getAddressSettings().put(AUTO_CREATION_QUEUE_PREFIX + "#", autoCreateQueueAddressSettings);
|
||||
|
||||
AddressSettings autoCreateTopicAddressSettings = new AddressSettings();
|
||||
autoCreateTopicAddressSettings.setAutoCreateQueues(true);
|
||||
|
@ -67,7 +67,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport {
|
|||
autoCreateTopicAddressSettings.setDefaultAddressRoutingType(RoutingType.MULTICAST);
|
||||
autoCreateTopicAddressSettings.setDefaultQueueRoutingType(RoutingType.MULTICAST);
|
||||
|
||||
server.getConfiguration().getAddressesSettings().put(AUTO_CREATION_TOPIC_PREFIX + "#", autoCreateTopicAddressSettings);
|
||||
server.getConfiguration().getAddressSettings().put(AUTO_CREATION_TOPIC_PREFIX + "#", autoCreateTopicAddressSettings);
|
||||
}
|
||||
|
||||
@Test(timeout = 60000)
|
||||
|
|
|
@ -243,7 +243,7 @@ public class AmqpClientTestSupport extends AmqpTestSupport {
|
|||
addressSettings.setDeadLetterAddress(SimpleString.toSimpleString(getDeadLetterAddress()));
|
||||
addressSettings.setExpiryAddress(SimpleString.toSimpleString(getDeadLetterAddress()));
|
||||
|
||||
server.getConfiguration().getAddressesSettings().put("#", addressSettings);
|
||||
server.getConfiguration().getAddressSettings().put("#", addressSettings);
|
||||
Set<TransportConfiguration> acceptors = server.getConfiguration().getAcceptorConfigurations();
|
||||
for (TransportConfiguration tc : acceptors) {
|
||||
if (tc.getName().equals(NETTY_ACCEPTOR)) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class AmqpSenderRoutingTypeTest extends JMSClientTestSupport {
|
|||
protected void configureAddressPolicy(ActiveMQServer server) {
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.setJournalType(JournalType.NIO);
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressSettings();
|
||||
if (map.size() == 0) {
|
||||
AddressSettings as = new AddressSettings();
|
||||
as.setDefaultAddressRoutingType(RoutingType.ANYCAST);
|
||||
|
@ -57,7 +57,7 @@ public class AmqpSenderRoutingTypeTest extends JMSClientTestSupport {
|
|||
|
||||
@Test
|
||||
public void testAMQPSenderHonourRoutingTypeOfExistingAddress() throws Exception {
|
||||
RoutingType routingType = server.getConfiguration().getAddressesSettings().get("#").getDefaultAddressRoutingType();
|
||||
RoutingType routingType = server.getConfiguration().getAddressSettings().get("#").getDefaultAddressRoutingType();
|
||||
Assert.assertEquals(RoutingType.ANYCAST, routingType);
|
||||
try (ActiveMQConnection coreConnection = (ActiveMQConnection) createCoreConnection();
|
||||
ClientSession clientSession = coreConnection.getSessionFactory().createSession()) {
|
||||
|
@ -86,7 +86,7 @@ public class AmqpSenderRoutingTypeTest extends JMSClientTestSupport {
|
|||
|
||||
@Test
|
||||
public void testAMQPSenderCreateQueueWithDefaultRoutingTypeIfAddressDoNotExist() throws Exception {
|
||||
RoutingType defaultRoutingType = server.getConfiguration().getAddressesSettings().get("#").getDefaultAddressRoutingType();
|
||||
RoutingType defaultRoutingType = server.getConfiguration().getAddressSettings().get("#").getDefaultAddressRoutingType();
|
||||
Assert.assertEquals(RoutingType.ANYCAST, defaultRoutingType);
|
||||
try (ActiveMQConnection coreConnection = (ActiveMQConnection) createCoreConnection();
|
||||
ClientSession clientSession = coreConnection.getSessionFactory().createSession()) {
|
||||
|
|
|
@ -89,8 +89,8 @@ public class DLQAfterExpiredMessageTest extends AmqpClientTestSupport {
|
|||
addressSettings.setDeadLetterAddress(SimpleString.toSimpleString(getDeadLetterAddress()));
|
||||
addressSettings.setExpiryAddress(SimpleString.toSimpleString(getExpiryQueue()));
|
||||
addressSettings.setMaxDeliveryAttempts(1);
|
||||
server.getConfiguration().getAddressesSettings().put("#", addressSettings);
|
||||
server.getConfiguration().getAddressesSettings().put(getExpiryQueue(), addressSettings);
|
||||
server.getConfiguration().getAddressSettings().put("#", addressSettings);
|
||||
server.getConfiguration().getAddressSettings().put(getExpiryQueue(), addressSettings);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -71,7 +71,7 @@ public class JMSMessageGroupsTest extends JMSClientTestSupport {
|
|||
addressSettings.setDefaultGroupFirstKey(SimpleString.toSimpleString("JMSXFirstInGroupID"));
|
||||
|
||||
|
||||
server.getConfiguration().getAddressesSettings().put("GroupFirst.#", addressSettings);
|
||||
server.getConfiguration().getAddressSettings().put("GroupFirst.#", addressSettings);
|
||||
}
|
||||
|
||||
@Test(timeout = 60000)
|
||||
|
|
|
@ -82,7 +82,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport {
|
|||
protected void configureAddressPolicy(ActiveMQServer server) {
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.setJournalType(JournalType.NIO);
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressSettings();
|
||||
if (map.size() == 0) {
|
||||
AddressSettings as = new AddressSettings();
|
||||
map.put("#", as);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class AmqpPagingTest extends AmqpClientTestSupport {
|
|||
super.addConfiguration(server);
|
||||
final Map<String, AddressSettings> addressesSettings = server.getConfiguration()
|
||||
.setReadWholePage(readWholePage)
|
||||
.getAddressesSettings();
|
||||
.getAddressSettings();
|
||||
addressesSettings.get("#")
|
||||
.setMaxSizeBytes(100000)
|
||||
.setPageSizeBytes(10000);
|
||||
|
@ -104,7 +104,7 @@ public class AmqpPagingTest extends AmqpClientTestSupport {
|
|||
Wait.assertEquals(MSG_COUNT, queueView::getMessageCount);
|
||||
PagingStore pagingStore = server.getPagingManager().getPageStore(SimpleString.toSimpleString(getQueueName()));
|
||||
Assert.assertTrue(pagingStore.isPaging());
|
||||
final int pageCacheMaxSize = server.getConfiguration().getAddressesSettings().get("#").getPageCacheMaxSize();
|
||||
final int pageCacheMaxSize = server.getConfiguration().getAddressSettings().get("#").getPageCacheMaxSize();
|
||||
Assert.assertThat("the size of the messages or the number of messages isn't enough",
|
||||
pagingStore.getNumberOfPages(), Matchers.greaterThan(pageCacheMaxSize));
|
||||
receiver.flow(MSG_COUNT);
|
||||
|
|
|
@ -71,8 +71,8 @@ public class AutoCreateTest extends ActiveMQTestBase {
|
|||
server = createServer(true, true);
|
||||
AddressSettings settings = new AddressSettings().setAutoCreateAddresses(true).setAutoDeleteAddresses(true).setAutoCreateQueues(true).setAutoDeleteQueues(true);
|
||||
|
||||
server.getConfiguration().getAddressesSettings().clear();
|
||||
server.getConfiguration().getAddressesSettings().put("#", settings);
|
||||
server.getConfiguration().getAddressSettings().clear();
|
||||
server.getConfiguration().getAddressSettings().put("#", settings);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -180,8 +180,8 @@ public class AutoCreateTest extends ActiveMQTestBase {
|
|||
AssertionLoggerHandler.startCapture();
|
||||
server.getConfiguration().setAddressQueueScanPeriod(-1); // disabling scanner, we will perform it manually
|
||||
AddressSettings settings = new AddressSettings().setAutoDeleteQueues(true).setAutoDeleteAddresses(true).setAutoDeleteAddressesDelay(10).setAutoDeleteQueuesDelay(10);
|
||||
server.getConfiguration().getAddressesSettings().clear();
|
||||
server.getConfiguration().getAddressesSettings().put("#", settings);
|
||||
server.getConfiguration().getAddressSettings().clear();
|
||||
server.getConfiguration().getAddressSettings().put("#", settings);
|
||||
server.start();
|
||||
String ADDRESS_NAME = getName();
|
||||
|
||||
|
@ -217,8 +217,8 @@ public class AutoCreateTest extends ActiveMQTestBase {
|
|||
AssertionLoggerHandler.startCapture();
|
||||
server.getConfiguration().setAddressQueueScanPeriod(-1); // disabling scanner, we will perform it manually
|
||||
AddressSettings settings = new AddressSettings().setAutoDeleteQueues(true).setAutoDeleteAddresses(true).setAutoDeleteAddressesDelay(10).setAutoDeleteQueuesDelay(10);
|
||||
server.getConfiguration().getAddressesSettings().clear();
|
||||
server.getConfiguration().getAddressesSettings().put("#", settings);
|
||||
server.getConfiguration().getAddressSettings().clear();
|
||||
server.getConfiguration().getAddressSettings().put("#", settings);
|
||||
server.start();
|
||||
String ADDRESS_NAME = getName();
|
||||
|
||||
|
|
|
@ -1399,7 +1399,7 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
|
|||
final AddressSettings settings = new AddressSettings();
|
||||
settings.setDefaultConsumerWindowSize(defaultConsumerWindowSize);
|
||||
messagingService.getConfiguration()
|
||||
.getAddressesSettings().put(queueA.toString(), settings);
|
||||
.getAddressSettings().put(queueA.toString(), settings);
|
||||
|
||||
messagingService.start();
|
||||
messagingService.createQueue(new QueueConfiguration(queueA).setRoutingType(RoutingType.ANYCAST));
|
||||
|
@ -1421,7 +1421,7 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
|
|||
final AddressSettings settings = new AddressSettings();
|
||||
settings.setDefaultConsumerWindowSize(defaultConsumerWindowSize);
|
||||
messagingService.getConfiguration()
|
||||
.getAddressesSettings().put(addressA.toString(), settings);
|
||||
.getAddressSettings().put(addressA.toString(), settings);
|
||||
|
||||
messagingService.start();
|
||||
messagingService.createQueue(new QueueConfiguration(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST));
|
||||
|
@ -1448,7 +1448,7 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
|
|||
final AddressSettings settings = new AddressSettings();
|
||||
settings.setDefaultConsumerWindowSize(defaultConsumerWindowSize);
|
||||
messagingService.getConfiguration()
|
||||
.getAddressesSettings().put("#", settings);
|
||||
.getAddressSettings().put("#", settings);
|
||||
|
||||
messagingService.start();
|
||||
messagingService.createQueue(new QueueConfiguration(queueA).setRoutingType(RoutingType.ANYCAST));
|
||||
|
|
|
@ -169,7 +169,7 @@ public class CoreClientTest extends ActiveMQTestBase {
|
|||
|
||||
Configuration configuration = createBasicConfig();
|
||||
configuration.clearAcceptorConfigurations();
|
||||
configuration.addAddressesSetting("#", new AddressSettings().setMaxSizeBytes(10 * 1024 * 1024).setPageSizeBytes(1024 * 1024));
|
||||
configuration.addAddressSetting("#", new AddressSettings().setMaxSizeBytes(10 * 1024 * 1024).setPageSizeBytes(1024 * 1024));
|
||||
|
||||
String baseAddress = "foo";
|
||||
|
||||
|
|
|
@ -123,13 +123,13 @@ public class InfiniteRedeliveryTest extends ActiveMQTestBase {
|
|||
protected void startServer(boolean reschedule) throws Exception {
|
||||
createReplicatedConfigs();
|
||||
Configuration configuration = liveServer.getServer().getConfiguration();
|
||||
configuration.getAddressesSettings().clear();
|
||||
configuration.getAddressSettings().clear();
|
||||
if (reschedule) {
|
||||
AddressSettings settings = new AddressSettings().setMaxDeliveryAttempts(Integer.MAX_VALUE).setRedeliveryDelay(1);
|
||||
configuration.getAddressesSettings().put("#", settings);
|
||||
configuration.getAddressSettings().put("#", settings);
|
||||
} else {
|
||||
AddressSettings settings = new AddressSettings().setMaxDeliveryAttempts(Integer.MAX_VALUE).setRedeliveryDelay(0);
|
||||
configuration.getAddressesSettings().put("#", settings);
|
||||
configuration.getAddressSettings().put("#", settings);
|
||||
}
|
||||
liveServer.start();
|
||||
backupServer.start();
|
||||
|
|
|
@ -56,7 +56,7 @@ public class MessageConsumerRollbackTest extends ActiveMQTestBase {
|
|||
server = createServer(true, true);
|
||||
|
||||
AddressSettings settings = new AddressSettings().setRedeliveryDelay(100);
|
||||
server.getConfiguration().getAddressesSettings().put("#", settings);
|
||||
server.getConfiguration().getAddressSettings().put("#", settings);
|
||||
|
||||
server.start();
|
||||
|
||||
|
|
|
@ -86,8 +86,8 @@ public class ProducerTest extends ActiveMQTestBase {
|
|||
final ServerLocator locator = createInVMNonHALocator();
|
||||
AddressSettings setting = new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK).setMaxSizeBytes(10 * 1024);
|
||||
server.stop();
|
||||
server.getConfiguration().getAddressesSettings().clear();
|
||||
server.getConfiguration().getAddressesSettings().put(QUEUE.toString(), setting);
|
||||
server.getConfiguration().getAddressSettings().clear();
|
||||
server.getConfiguration().getAddressSettings().put(QUEUE.toString(), setting);
|
||||
server.start();
|
||||
|
||||
server.createQueue(new QueueConfiguration(QUEUE));
|
||||
|
|
|
@ -183,7 +183,7 @@ public class AutoDeleteDistributedTest extends ClusterTestBase {
|
|||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
servers[0].getConfiguration().addAddressesSetting("*", new AddressSettings().setAutoCreateAddresses(true) //
|
||||
servers[0].getConfiguration().addAddressSetting("*", new AddressSettings().setAutoCreateAddresses(true) //
|
||||
.setAutoCreateQueues(true) //
|
||||
.setAutoDeleteAddresses(true) //
|
||||
.setAutoDeleteQueues(true) // --> this causes IllegalStateExceptions
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ClusteredMessageCounterTest extends ClusterTestBase {
|
|||
@Override
|
||||
protected ConfigurationImpl createBasicConfig(final int serverID) {
|
||||
ConfigurationImpl config = super.createBasicConfig(serverID);
|
||||
Map<String, AddressSettings> addrSettingsMap = config.getAddressesSettings();
|
||||
Map<String, AddressSettings> addrSettingsMap = config.getAddressSettings();
|
||||
AddressSettings addrSettings = new AddressSettings();
|
||||
addrSettings.setMaxSizeBytes(10 * 1024);
|
||||
addrSettings.setPageSizeBytes(5 * 1024);
|
||||
|
|
|
@ -118,8 +118,8 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase {
|
|||
closeAllSessionFactories();
|
||||
stopServers(0, 1);
|
||||
|
||||
AddressSettings addressSettings0 = config0.getAddressesSettings().get("#");
|
||||
AddressSettings addressSettings1 = config1.getAddressesSettings().get("#");
|
||||
AddressSettings addressSettings0 = config0.getAddressSettings().get("#");
|
||||
AddressSettings addressSettings1 = config1.getAddressSettings().get("#");
|
||||
|
||||
addressSettings0.setMaxSizeBytes(-1);
|
||||
addressSettings1.setMaxSizeBytes(-1);
|
||||
|
@ -151,7 +151,7 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase {
|
|||
config.setJournalMinFiles(20);
|
||||
config.setJournalCompactPercentage(50);
|
||||
|
||||
Map<String, AddressSettings> addressSettingsMap0 = config.getAddressesSettings();
|
||||
Map<String, AddressSettings> addressSettingsMap0 = config.getAddressSettings();
|
||||
AddressSettings addrSettings = addressSettingsMap0.get("#");
|
||||
if (addrSettings == null) {
|
||||
addrSettings = new AddressSettings();
|
||||
|
|
|
@ -57,8 +57,8 @@ public class SharedStoreScaleDownBackupTest extends ClusterTestBase {
|
|||
setScaleDownConfiguration(new ScaleDownConfiguration().setEnabled(true).addConnector(
|
||||
getServer(2).getConfiguration().getClusterConfigurations().get(0).getStaticConnectors().get(0)));
|
||||
|
||||
getServer(0).getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
getServer(1).getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
getServer(0).getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
getServer(1).getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class AMQPToJMSCoreTest extends ActiveMQTestBase {
|
|||
server.waitForActivation(10, TimeUnit.SECONDS);
|
||||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false)
|
||||
serverConfig.getAddressSettings().put("#", new AddressSettings().setAutoCreateQueues(false)
|
||||
.setAutoCreateAddresses(false)
|
||||
.setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.setSecurityEnabled(false);
|
||||
|
|
|
@ -73,7 +73,7 @@ public class AMQPToOpenwireTest extends ActiveMQTestBase {
|
|||
server.waitForActivation(10, TimeUnit.SECONDS);
|
||||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.getAddressSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.setSecurityEnabled(false);
|
||||
coreQueue = new SimpleString(queueName);
|
||||
server.createQueue(new QueueConfiguration(coreQueue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
|
|
|
@ -54,7 +54,7 @@ public class AMQPToStompTest extends ActiveMQTestBase {
|
|||
server.waitForActivation(10, TimeUnit.SECONDS);
|
||||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false)
|
||||
serverConfig.getAddressSettings().put("#", new AddressSettings().setAutoCreateQueues(false)
|
||||
.setAutoCreateAddresses(false)
|
||||
.setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.setSecurityEnabled(false);
|
||||
|
|
|
@ -60,7 +60,7 @@ public class OpenWireToAMQPTest extends ActiveMQTestBase {
|
|||
super.setUp();
|
||||
server = createServer(true, true);
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true).setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.getAddressSettings().put("#", new AddressSettings().setAutoCreateQueues(true).setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.setSecurityEnabled(false);
|
||||
server.start();
|
||||
coreQueue = new SimpleString(queueName);
|
||||
|
|
|
@ -58,7 +58,7 @@ public class OpenwireAmqpResenderTest extends ActiveMQTestBase {
|
|||
qpidFactory = new JmsConnectionFactory(AMQP_URL);
|
||||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true)
|
||||
serverConfig.getAddressSettings().put("#", new AddressSettings().setAutoCreateQueues(true)
|
||||
.setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.setSecurityEnabled(false);
|
||||
server.start();
|
||||
|
|
|
@ -427,7 +427,7 @@ public class DivertTest extends ActiveMQTestBase {
|
|||
|
||||
DivertConfiguration divertConf = new DivertConfiguration().setName("divert1").setRoutingName("divert1").setAddress(testAddress).setForwardingAddress(forwardAddress);
|
||||
|
||||
Configuration config = createDefaultInVMConfig().addDivertConfiguration(divertConf).clearAddressesSettings().addAddressesSetting("#", expirySettings);
|
||||
Configuration config = createDefaultInVMConfig().addDivertConfiguration(divertConf).clearAddressSettings().addAddressSetting("#", expirySettings);
|
||||
|
||||
ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, true));
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class DuplicateRecordIdTest extends ActiveMQTestBase {
|
|||
@Before
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
server = createServer(false, createDefaultInVMConfig().addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(new SimpleString("dlq")).setExpiryAddress(new SimpleString("dlq"))));
|
||||
server = createServer(false, createDefaultInVMConfig().addAddressSetting("#", new AddressSettings().setDeadLetterAddress(new SimpleString("dlq")).setExpiryAddress(new SimpleString("dlq"))));
|
||||
server.getConfiguration().setPersistenceEnabled(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ public class MQTTTestSupport extends ActiveMQTestBase {
|
|||
AddressSettings addressSettings = new AddressSettings();
|
||||
addressSettings.setDeadLetterAddress(SimpleString.toSimpleString("DLA"));
|
||||
addressSettings.setExpiryAddress(SimpleString.toSimpleString("EXPIRY"));
|
||||
defaultConfig.getAddressesSettings().put("#", addressSettings);
|
||||
defaultConfig.getAddressSettings().put("#", addressSettings);
|
||||
return createServer(true, defaultConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -1299,11 +1299,11 @@ public class MqttClusterRemoteSubscribeTest extends ClusterTestBase {
|
|||
setupServer(0, false, isNetty());
|
||||
servers[0].getConfiguration().setWildCardConfiguration(wildcardConfiguration);
|
||||
servers[0].getConfiguration().addAddressConfiguration(coreAddressConfiguration);
|
||||
servers[0].getConfiguration().addAddressesSetting("#", addressSettings);
|
||||
servers[0].getConfiguration().addAddressSetting("#", addressSettings);
|
||||
setupServer(1, false, isNetty());
|
||||
servers[1].getConfiguration().setWildCardConfiguration(wildcardConfiguration);
|
||||
servers[1].getConfiguration().addAddressConfiguration(coreAddressConfiguration);
|
||||
servers[1].getConfiguration().addAddressesSetting("#", addressSettings);
|
||||
servers[1].getConfiguration().addAddressSetting("#", addressSettings);
|
||||
|
||||
setupClusterConnection("cluster0", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
|
|
@ -142,8 +142,8 @@ public class MqttClusterWildcardTest extends ClusterTestBase {
|
|||
// allow redistribution
|
||||
AddressSettings addressSettings = new AddressSettings();
|
||||
addressSettings.setRedistributionDelay(0);
|
||||
servers[0].getConfiguration().addAddressesSetting("#", addressSettings);
|
||||
servers[1].getConfiguration().addAddressesSetting("#", addressSettings);
|
||||
servers[0].getConfiguration().addAddressSetting("#", addressSettings);
|
||||
servers[1].getConfiguration().addAddressSetting("#", addressSettings);
|
||||
|
||||
setupClusterConnection("cluster0", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
|
|
@ -239,7 +239,7 @@ public class MQTT5TestSupport extends ActiveMQTestBase {
|
|||
AddressSettings addressSettings = new AddressSettings();
|
||||
addressSettings.setDeadLetterAddress(DEAD_LETTER_ADDRESS);
|
||||
addressSettings.setExpiryAddress(EXPIRY_ADDRESS);
|
||||
defaultConfig.getAddressesSettings().put("#", addressSettings);
|
||||
defaultConfig.getAddressSettings().put("#", addressSettings);
|
||||
defaultConfig.setMqttSessionScanInterval(200);
|
||||
return createServer(true, defaultConfig);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class LargeMessageQueueAutoCreationTest extends BasicOpenWireTest {
|
|||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
serverConfig.setJournalType(JournalType.NIO);
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> map = serverConfig.getAddressSettings();
|
||||
Map.Entry<String, AddressSettings> entry = map.entrySet().iterator().next();
|
||||
AddressSettings settings = entry.getValue();
|
||||
settings.setAutoCreateQueues(true);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class OpenWireTestBase extends ActiveMQTestBase {
|
|||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
|
||||
Map<String, AddressSettings> addressSettingsMap = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> addressSettingsMap = serverConfig.getAddressSettings();
|
||||
|
||||
configureAddressSettings(addressSettingsMap);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveT
|
|||
|
||||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
AddressSettings settings = serverConfig.getAddressesSettings().get("#");
|
||||
AddressSettings settings = serverConfig.getAddressSettings().get("#");
|
||||
if (settings != null) {
|
||||
settings.setAutoCreateQueues(true);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ProducerAutoCreateQueueTest extends BasicOpenWireTest {
|
|||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
serverConfig.setAddressQueueScanPeriod(100);
|
||||
String match = "#";
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressSettings();
|
||||
asMap.get(match).setAutoCreateAddresses(true).setAutoCreateQueues(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ProducerBlockingTtlTest extends BasicOpenWireTest {
|
|||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
String match = "#";
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressSettings();
|
||||
asMap.get(match).setMaxSizeBytes(1).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ public class ProducerFlowControlBaseTest extends BasicOpenWireTest {
|
|||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
String match = "#";
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressSettings();
|
||||
asMap.get(match).setMaxSizeBytes(1).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ProducerFlowControlSendFailTest extends ProducerFlowControlBaseTest
|
|||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
String match = "#";
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressesSettings();
|
||||
Map<String, AddressSettings> asMap = serverConfig.getAddressSettings();
|
||||
asMap.get(match).setMaxSizeBytes(1).setAddressFullMessagePolicy(AddressFullMessagePolicy.FAIL);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ public class AnonymousProducerPageTest extends ActiveMQTestBase {
|
|||
|
||||
this.server = addServer(this.createServer(true, true));
|
||||
|
||||
server.getConfiguration().getAddressesSettings().clear();
|
||||
server.getConfiguration().addAddressesSetting("#", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE));
|
||||
server.getConfiguration().getAddressSettings().clear();
|
||||
server.getConfiguration().addAddressSetting("#", new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE));
|
||||
|
||||
server.getConfiguration().getAcceptorConfigurations().clear();
|
||||
server.getConfiguration().getAcceptorConfigurations().add(addAcceptorConfiguration(server, port));
|
||||
|
|
|
@ -72,7 +72,7 @@ public class MultipleProducersPagingTest extends ActiveMQTestBase {
|
|||
|
||||
server = createServer(createBasicConfig()
|
||||
.setPersistenceEnabled(false)
|
||||
.setAddressesSettings(Collections.singletonMap("#", new AddressSettings()
|
||||
.setAddressSettings(Collections.singletonMap("#", new AddressSettings()
|
||||
.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
|
||||
.setPageSizeBytes(50000)
|
||||
.setMaxSizeBytes(404850)))
|
||||
|
|
|
@ -51,7 +51,7 @@ public class SpawnedServerSupport {
|
|||
static Configuration createConfig(String folder) {
|
||||
AddressSettings settings = new AddressSettings().setMaxDeliveryAttempts(-1).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setPageSizeBytes(10 * 1024).setMaxSizeBytes(100 * 1024);
|
||||
|
||||
Configuration config = new ConfigurationImpl().setSecurityEnabled(false).setJournalMinFiles(2).setJournalFileSize(100 * 1024).setJournalType(ActiveMQTestBase.getDefaultJournalType()).setJournalCompactMinFiles(0).setJournalCompactPercentage(0).setClusterPassword(ActiveMQTestBase.CLUSTER_PASSWORD).setJournalDirectory(ActiveMQTestBase.getJournalDir(folder, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(folder, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(folder, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(folder, 0, false)).setPersistenceEnabled(true).addAddressesSetting("#", settings).addAcceptorConfiguration(new TransportConfiguration(ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY));
|
||||
Configuration config = new ConfigurationImpl().setSecurityEnabled(false).setJournalMinFiles(2).setJournalFileSize(100 * 1024).setJournalType(ActiveMQTestBase.getDefaultJournalType()).setJournalCompactMinFiles(0).setJournalCompactPercentage(0).setClusterPassword(ActiveMQTestBase.CLUSTER_PASSWORD).setJournalDirectory(ActiveMQTestBase.getJournalDir(folder, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(folder, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(folder, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(folder, 0, false)).setPersistenceEnabled(true).addAddressSetting("#", settings).addAcceptorConfiguration(new TransportConfiguration(ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY));
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ConfigChangeTest extends ActiveMQTestBase {
|
|||
@Test
|
||||
public void testChangeQueueRoutingTypeOnRestart() throws Exception {
|
||||
Configuration configuration = createDefaultInVMConfig();
|
||||
configuration.addAddressesSetting("#", new AddressSettings());
|
||||
configuration.addAddressSetting("#", new AddressSettings());
|
||||
|
||||
List addressConfigurations = new ArrayList();
|
||||
CoreAddressConfiguration addressConfiguration = new CoreAddressConfiguration()
|
||||
|
@ -93,7 +93,7 @@ public class ConfigChangeTest extends ActiveMQTestBase {
|
|||
final String filter2 = "x = 'y'";
|
||||
|
||||
Configuration configuration = createDefaultInVMConfig( );
|
||||
configuration.addAddressesSetting("#", new AddressSettings());
|
||||
configuration.addAddressSetting("#", new AddressSettings());
|
||||
|
||||
List addressConfigurations = new ArrayList();
|
||||
CoreAddressConfiguration addressConfiguration = new CoreAddressConfiguration()
|
||||
|
|
|
@ -93,7 +93,7 @@ public class OpenwirePluginTest extends BasicOpenWireTest {
|
|||
}
|
||||
});
|
||||
|
||||
configuration.getAddressesSettings().put("autoCreated", new AddressSettings().setAutoDeleteAddresses(true)
|
||||
configuration.getAddressSettings().put("autoCreated", new AddressSettings().setAutoDeleteAddresses(true)
|
||||
.setAutoDeleteQueues(true).setAutoCreateQueues(true).setAutoCreateAddresses(true));
|
||||
|
||||
return server;
|
||||
|
|
|
@ -425,7 +425,7 @@ public class ElasticQueueTest extends ActiveMQTestBase {
|
|||
.setAutoDeleteQueues(false).setAutoDeleteAddresses(false); // so slow consumer can kick in!
|
||||
|
||||
Configuration baseConfig = new ConfigurationImpl();
|
||||
baseConfig.getAddressesSettings().put(qName, blockingQueue);
|
||||
baseConfig.getAddressSettings().put(qName, blockingQueue);
|
||||
|
||||
ConnectionRouterConfiguration connectionRouterConfiguration = new ConnectionRouterConfiguration();
|
||||
connectionRouterConfiguration.setName(roleNameSharder).setKeyType(KeyType.ROLE_NAME).setKeyFilter("(?<=^EQ_).*"); // strip EQ_ prefix
|
||||
|
|
|
@ -744,7 +744,7 @@ public class ScheduledMessageTest extends ActiveMQTestBase {
|
|||
|
||||
server.stop();
|
||||
|
||||
configuration = createDefaultInVMConfig().addAddressesSetting(atestq.toString(), qs);
|
||||
configuration = createDefaultInVMConfig().addAddressSetting(atestq.toString(), qs);
|
||||
|
||||
server = createServer(true, configuration);
|
||||
server.start();
|
||||
|
|
|
@ -46,7 +46,7 @@ public class PotentialOOMELoggingTest extends ActiveMQTestBase {
|
|||
server.getConfiguration().addQueueConfiguration(new QueueConfiguration(UUID.randomUUID().toString()));
|
||||
}
|
||||
server.getConfiguration().setGlobalMaxSize(-1);
|
||||
server.getConfiguration().getAddressesSettings().put("#", new AddressSettings().setMaxSizeBytes(10485760 * 10));
|
||||
server.getConfiguration().getAddressSettings().put("#", new AddressSettings().setMaxSizeBytes(10485760 * 10));
|
||||
server.start();
|
||||
|
||||
// Using the code only so the test doesn't fail just because someone edits the log text
|
||||
|
|
|
@ -58,8 +58,8 @@ public class ScaleDownRemoveSFTest extends ClusterTestBase {
|
|||
setupClusterConnection("cluster0", "testAddress", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
haPolicyConfiguration0.getScaleDownConfiguration().getConnectors().addAll(servers[0].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
haPolicyConfiguration1.getScaleDownConfiguration().getConnectors().addAll(servers[1].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
servers[0].getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[1].getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[0].getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[1].getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
startServers(0, 1);
|
||||
setupSessionFactory(0, isNetty());
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
|
|
@ -100,8 +100,8 @@ public class ScaleDownTest extends ClusterTestBase {
|
|||
setupClusterConnection("cluster0", "testAddress", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
haPolicyConfiguration0.getScaleDownConfiguration().getConnectors().addAll(servers[0].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
haPolicyConfiguration1.getScaleDownConfiguration().getConnectors().addAll(servers[1].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
servers[0].getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[1].getConfiguration().getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[0].getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
servers[1].getConfiguration().getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
startServers(0, 1);
|
||||
setupSessionFactory(0, isNetty());
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
|
|
@ -169,7 +169,7 @@ public class JMSClusteredTestBase extends ActiveMQTestBase {
|
|||
}
|
||||
}));
|
||||
|
||||
configuration.getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
configuration.getAddressSettings().put("#", new AddressSettings().setRedistributionDelay(0));
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue