From fe1ba7ca21b7386029ada3a64e7ceab97dfc90ad Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Tue, 13 Jan 2015 14:04:48 -0600 Subject: [PATCH] ACTIVEMQ6-69 remove deprecated items --- .../config/ActiveMQDefaultConfiguration.java | 22 -- .../api/core/client/ClientSession.java | 9 - .../api/core/client/ServerLocator.java | 25 -- .../management/ActiveMQServerControl.java | 12 - .../api/core/management/QueueControl.java | 10 - .../core/client/impl/AddressQueryImpl.java | 2 +- .../core/client/impl/ClientSessionImpl.java | 13 - .../core/client/impl/ServerLocatorImpl.java | 14 - .../api/jms/management/JMSQueueControl.java | 14 - .../management/impl/JMSQueueControlImpl.java | 15 - .../ra/ConnectionFactoryProperties.java | 11 - .../activemq/core/config/Configuration.java | 203 -------------- .../core/config/impl/ConfigurationImpl.java | 210 -------------- .../impl/FileConfigurationParser.java | 256 +----------------- .../management/impl/QueueControlImpl.java | 46 ---- .../schema/activemq-configuration.xsd | 160 +---------- .../impl/FileConfigurationParserTest.java | 2 - .../config/impl/FileConfigurationTest.java | 2 +- .../WrongRoleFileConfigurationParserTest.java | 1 - .../ConfigurationTest-full-config.xml | 23 +- .../resources/InvalidConfigurationTest0.xml | 7 +- .../resources/InvalidConfigurationTest1.xml | 7 +- .../resources/InvalidConfigurationTest2.xml | 7 +- .../resources/InvalidConfigurationTest3.xml | 7 +- .../resources/InvalidConfigurationTest4.xml | 7 +- .../resources/InvalidConfigurationTest5.xml | 7 +- .../resources/colocated-hapolicy-config.xml | 5 +- .../resources/live-only-hapolicy-config.xml | 6 +- .../resources/replica-hapolicy-config.xml | 7 +- .../shared-store-slave-hapolicy-config.xml | 6 +- docs/user-manual/en/ha.md | 4 +- .../tests/integration/InterceptorTest.java | 4 +- .../integration/client/HangConsumerTest.java | 2 +- .../failover/ReplicatedFailoverTest.java | 8 +- .../management/JMSQueueControlTest.java | 28 +- .../management/QueueControlTest.java | 19 +- 36 files changed, 105 insertions(+), 1076 deletions(-) diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/config/ActiveMQDefaultConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/config/ActiveMQDefaultConfiguration.java index 4b8285e94a..01e789dbed 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/config/ActiveMQDefaultConfiguration.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/config/ActiveMQDefaultConfiguration.java @@ -216,12 +216,6 @@ public final class ActiveMQDefaultConfiguration // true means that ID's are persisted to the journal private static boolean DEFAULT_PERSIST_ID_CACHE = true; - // DEPRECATED. This option is deprecated, but it will still be honored if is not also used. It indicates whether this server is a backup server - private static boolean DEFAULT_BACKUP = false; - - // DEPRECATED. This option is deprecated, but it will still be honored if is not also used. 'shared-store' applies to live and backup pairs, and it indicates if the live/backup pair share storage or if the data is replicated among them. - private static boolean DEFAULT_SHARED_STORE = false; - // True means that the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. private static boolean DEFAULT_PERSIST_DELIVERY_COUNT_BEFORE_DELIVERY = false; @@ -622,22 +616,6 @@ public final class ActiveMQDefaultConfiguration return DEFAULT_PERSIST_ID_CACHE; } - /** - * DEPRECATED. This option is deprecated, but it will still be honored if is not also used. It indicates whether this server is a backup server - */ - public static boolean isDefaultBackup() - { - return DEFAULT_BACKUP; - } - - /** - * DEPRECATED. This option is deprecated, but it will still be honored if is not also used. 'shared-store' applies to live and backup pairs, and it indicates if the live/backup pair share storage or if the data is replicated among them. - */ - public static boolean isDefaultSharedStore() - { - return DEFAULT_SHARED_STORE; - } - /** * True means that the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. */ diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSession.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSession.java index 75116fc38a..63cccf881d 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSession.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSession.java @@ -56,15 +56,6 @@ public interface ClientSession extends XAResource, AutoCloseable boolean isAutoCreateJmsQueues(); } - /** - * @deprecated Use {@link org.apache.activemq.api.core.client.ClientSession.AddressQuery} instead - */ - @Deprecated - public interface BindingQuery extends AddressQuery - { - - } - /** * Information returned by a queue query * diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java index 30bec1b7d6..aaf62ba760 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java @@ -689,18 +689,6 @@ public interface ServerLocator extends AutoCloseable */ ServerLocator setInitialMessagePacketSize(int size); - /** - * Adds an interceptor which will be executed after packets are received from the server. Invoking this - * method is the same as invoking addIncomingInterceptor(Interceptor). - * - * @param interceptor an Interceptor - * @deprecated As of ActiveMQ 2.3.0.Final, replaced by - * {@link #addIncomingInterceptor(Interceptor)} and - * {@link #addOutgoingInterceptor(Interceptor)} - */ - @Deprecated - void addInterceptor(Interceptor interceptor); - /** * Adds an interceptor which will be executed after packets are received from the server. * @@ -717,19 +705,6 @@ public interface ServerLocator extends AutoCloseable */ ServerLocator addOutgoingInterceptor(Interceptor interceptor); - /** - * Removes an interceptor. Invoking this method is the same as invoking - * removeIncomingInterceptor(Interceptor). - * - * @param interceptor interceptor to remove - * @return true if the interceptor is removed from this factory, false else - * @deprecated As of ActiveMQ 2.3.0.Final, replaced by - * {@link #removeIncomingInterceptor(Interceptor)} and - * {@link #removeOutgoingInterceptor(Interceptor)} - */ - @Deprecated - boolean removeInterceptor(Interceptor interceptor); - /** * Removes an incoming interceptor. * diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java index 6c2b64e658..bd0d269639 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java @@ -38,18 +38,6 @@ public interface ActiveMQServerControl */ boolean isStarted(); - /** - * Returns the list of interceptors used by this server. Invoking this method is the same as invoking - * getIncomingInterceptorClassNames(). - * - * @see org.apache.activemq.api.core.Interceptor - * @deprecated As of ActiveMQ 2.3.0.Final, replaced by - * {@link #getIncomingInterceptorClassNames()} and - * {@link #getOutgoingInterceptorClassNames()} - */ - @Deprecated - String[] getInterceptorClassNames(); - /** * Returns the list of interceptors used by this server for incoming messages. * diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/QueueControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/QueueControl.java index 6310afed87..9d2071312b 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/QueueControl.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/QueueControl.java @@ -99,21 +99,11 @@ public interface QueueControl */ String getExpiryAddress(); - /** - * Sets the expiry address associated to this queue to the specified expiryAddress. - */ - void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception; - /** * Returns the dead-letter address associated to this queue. */ String getDeadLetterAddress(); - /** - * Sets the dead-letter address associated to this queue to the specified deadLetterAddress. - */ - void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception; - // Operations ---------------------------------------------------- /** diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/AddressQueryImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/AddressQueryImpl.java index 6c7c8a3a05..eb0268e976 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/AddressQueryImpl.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/AddressQueryImpl.java @@ -22,7 +22,7 @@ import java.util.List; import org.apache.activemq.api.core.SimpleString; import org.apache.activemq.api.core.client.ClientSession; -public class AddressQueryImpl implements ClientSession.AddressQuery, ClientSession.BindingQuery +public class AddressQueryImpl implements ClientSession.AddressQuery { private final boolean exists; diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java index 4f5defb2bb..cbe5ce4e13 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java @@ -362,19 +362,6 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi } - /** - * Use {@link #addressQuery(org.apache.activemq.api.core.SimpleString)} instead - * - * @param address - * @return - * @throws org.apache.activemq.api.core.ActiveMQException - */ - @Deprecated - public BindingQuery bindingQuery(final SimpleString address) throws ActiveMQException - { - return (BindingQuery) addressQuery(address); - } - public AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { checkClosed(); diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java index aa04c4381b..268f9c70da 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java @@ -1315,13 +1315,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery return discoveryGroupConfiguration; } - @Override - @Deprecated - public void addInterceptor(final Interceptor interceptor) - { - addIncomingInterceptor(interceptor); - } - public ServerLocatorImpl addIncomingInterceptor(final Interceptor interceptor) { incomingInterceptors.add(interceptor); @@ -1334,13 +1327,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery return this; } - @Override - @Deprecated - public boolean removeInterceptor(final Interceptor interceptor) - { - return removeIncomingInterceptor(interceptor); - } - public boolean removeIncomingInterceptor(final Interceptor interceptor) { return incomingInterceptors.remove(interceptor); diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSQueueControl.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSQueueControl.java index 6eac841a9b..8e9b270f21 100644 --- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSQueueControl.java +++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSQueueControl.java @@ -37,25 +37,11 @@ public interface JMSQueueControl extends DestinationControl */ String getExpiryAddress(); - /** - * Sets the expiry address associated to this queue to the specified expiryAddress. - * @deprecated: it's non persisted. Use the proper address settings - */ - @Deprecated - void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception; - /** * Returns the dead-letter address associated to this queue. */ String getDeadLetterAddress(); - /** - * Sets the dead-letter address associated to this queue to the specified deadLetterAddress. - * @deprecated: it's non persisted. Use the proper address settings - */ - @Deprecated - void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception; - /** * Returns the number of scheduled messages in this queue. */ diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java index 7c85e8cadc..2b7a4dcfef 100644 --- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java +++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java @@ -143,32 +143,17 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro return coreQueueControl.getDeadLetterAddress(); } - public void setDeadLetterAddress(final String deadLetterAddress) throws Exception - { - coreQueueControl.setDeadLetterAddress(deadLetterAddress); - } - public String getExpiryAddress() { return coreQueueControl.getExpiryAddress(); } - public void setExpiryAddress(final String expiryAddress) throws Exception - { - coreQueueControl.setExpiryAddress(expiryAddress); - } - @Override public void addBinding(String binding) throws Exception { jmsServerManager.addQueueToBindingRegistry(managedQueue.getName(), binding); } - public void removeBinding(String binding) throws Exception - { - jmsServerManager.removeQueueFromBindingRegistry(managedQueue.getName(), binding); - } - public String[] getRegistryBindings() { return jmsServerManager.getBindingsOnQueue(managedQueue.getName()); diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java index 8cdf7a82e3..53c12b0bd6 100644 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java @@ -313,17 +313,6 @@ public class ConnectionFactoryProperties this.clientID = clientID; } - /** - * This is for backward compatibility with the JBoss Application Server. - * @see ConnectionFactoryAttributes.java - */ - @Deprecated - public void setClientId(final String clientID) - { - setClientID(clientID); - } - public Integer getDupsOKBatchSize() { if (ConnectionFactoryProperties.trace) diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java b/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java index f6974cd52f..72b29dd544 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java @@ -47,43 +47,12 @@ public interface Configuration extends Serializable */ Configuration setName(String name); - /** - * returns the name used to group of live/backup servers - * - * @return the name of the group - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.HAPolicy#getBackupGroupName()} - */ - @Deprecated - String getBackupGroupName(); - - /** - * Used to configure groups of live/backup servers. - * - * @param nodeGroupName the node group name - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - Configuration setBackupGroupName(String nodeGroupName); - /** * Returns whether this server is clustered.
* {@code true} if {@link #getClusterConfigurations()} is not empty. */ boolean isClustered(); - /** - * Returns whether a backup will automatically stop when a live server is restarting (i.e. - * failing back). - * - * @return {@code true} if the backup will stop when the live server restarts - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - boolean isAllowFailBack(); - /** * Returns whether delivery count is persisted before messages are delivered to the consumers.
* Default value is @@ -96,41 +65,6 @@ public interface Configuration extends Serializable */ Configuration setPersistDeliveryCountBeforeDelivery(boolean persistDeliveryCountBeforeDelivery); - /** - * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
- * If a backup server has been activated, returns {@code false}.
- * Default value is {@value org.apache.activemq.api.config.ActiveMQDefaultConfiguration#DEFAULT_BACKUP}. - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.HAPolicy#isBackup()} - */ - @Deprecated - boolean isBackup(); - - /** - * Formerly set whether this server is a backup or not. - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - Configuration setBackup(boolean backup); - - /** - * Returns whether this server shares its data store with a corresponding live or backup server.
- * Default value is {@value org.apache.activemq.api.config.ActiveMQDefaultConfiguration#DEFAULT_SHARED_STORE}. - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.HAPolicy#isSharedStore()} - */ - @Deprecated - boolean isSharedStore(); - - /** - * Formerly set whether this server shares its data store with a backup or live server. - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - Configuration setSharedStore(boolean sharedStore); - /** * Returns whether this server is using persistence and store data.
* Default value is {@value org.apache.activemq.api.config.ActiveMQDefaultConfiguration#DEFAULT_PERSISTENCE_ENABLED}. @@ -223,17 +157,6 @@ public interface Configuration extends Serializable */ Configuration setJMXDomain(String domain); - /** - * Returns the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to - * the server from clients). Invoking this method is the same as invoking getIncomingInterceptorClassNames(). - * - * @deprecated As of ActiveMQ 2.3.0.Final, replaced by - * {@link #getIncomingInterceptorClassNames()} and - * {@link #getOutgoingInterceptorClassNames()} - */ - @Deprecated - List getInterceptorClassNames(); - /** * Returns the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to * the server from clients). @@ -246,21 +169,6 @@ public interface Configuration extends Serializable */ List getOutgoingInterceptorClassNames(); - /** - * Sets the list of interceptors classes used by this server for incoming messages (i.e. those - * being delivered to the server from clients). Invoking this method is the same as invoking - * setIncomingInterceptorClassNames(List)
- * Classes must implement {@link org.apache.activemq.api.core.Interceptor}. - *

- * Deprecated but not immediately deleted, as embedded users may be using this file. - * - * @deprecated As of ActiveMQ 2.3.0.Final, replaced by - * {@link #setIncomingInterceptorClassNames(List)} and - * {@link #setOutgoingInterceptorClassNames(List)} - */ - @Deprecated - Configuration setInterceptorClassNames(List interceptors); - /** * Sets the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to * the server from clients). @@ -452,30 +360,6 @@ public interface Configuration extends Serializable */ String getClusterPassword(); - /** - * Should we notify any clients on close that they should failover. - * - * @return true if clients should failover - * @see #setFailoverOnServerShutdown(boolean) - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - boolean isFailoverOnServerShutdown(); - - /** - * Sets whether to allow clients to failover on server shutdown. - *

- * When a live server is restarted after failover the backup will shutdown if - * {@link org.apache.activemq.core.server.cluster.ha.HAPolicy#isAllowAutoFailBack()} is true. This is not regarded as a normal shutdown. In this - * case {@code failoverOnServerShutdown} is ignored, and the server will behave as if it was set - * to {@code true}. - * - * @deprecated you should replace by using the correct {@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - Configuration setFailoverOnServerShutdown(boolean failoverOnServerShutdown); - /** * Sets the cluster password for this server. */ @@ -897,48 +781,6 @@ public interface Configuration extends Serializable */ List getConnectorServiceConfigurations(); - /** - * Returns the delay to wait before fail-back occurs on restart. - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.BackupPolicy#getFailbackDelay()} - */ - @Deprecated - long getFailbackDelay(); - - /** - * Sets the fail-back delay. - * - * @deprecated replaced by {@link org.apache.activemq.core.server.cluster.ha.BackupPolicy#setFailbackDelay(long)} - */ - @Deprecated - Configuration setFailbackDelay(long delay); - - /** - * Whether to check if the cluster already has a (live) node with our node-ID. - *

- * If the cluster does contain a server using this server's node-ID, then this server will assume - * that fail-over has occurred and will try to trigger a fail-back. - *

- * Enabling this check will slow down a server start-up slightly. - * - * @return true if we want to make the check - */ - @Deprecated - boolean isCheckForLiveServer(); - - /** - * Sets whether to check if the cluster already has a (live) node with our node-ID. - *

- * If the cluster does contain a server using this server's node-ID, then this server will assume - * that fail-over has occurred and will try to trigger a fail-back. - *

- * Enabling this check will slow down a server start-up slightly. - * - * @param checkForLiveServer true if we want to make the check - */ - @Deprecated - Configuration setCheckForLiveServer(boolean checkForLiveServer); - /** * The default password decoder */ @@ -959,29 +801,6 @@ public interface Configuration extends Serializable */ boolean isMaskPassword(); - /** - * Name of the cluster configuration to use for replication. - *

- * Only applicable for servers with more than one cluster configuration. This value is only used - * by replicating backups and live servers that attempt fail-back. - * - * @param clusterName - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - - @Deprecated - Configuration setReplicationClustername(String clusterName); - - /** - * @return name of the cluster configuration to use - * @see #setReplicationClustername(String) - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - String getReplicationClustername(); - /* * Whether or not that ActiveMQ should use all protocols available on the classpath. If false only the core protocol will * be set, any other protocols will need to be set directly on the ActiveMQServer @@ -995,28 +814,6 @@ public interface Configuration extends Serializable * */ boolean isResolveProtocols(); - /** - * How many backup journals to keep after failback occurs. - *

- * This value is only used by replicating backups after a live server has failed back. Beofre the backup restarts - * it will copy its journals into another directory to keep. - * - * @param maxSavedReplicatedJournalsSize - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - Configuration setMaxSavedReplicatedJournalSize(int maxSavedReplicatedJournalsSize); - - /** - * @return the number of backup journals to keep after failback has occurred - * @see #setMaxSavedReplicatedJournalSize(int) - * - * @deprecated you should replace by using the correct{@link org.apache.activemq.core.server.cluster.ha.HAPolicy} - */ - @Deprecated - int getMaxSavedReplicatedJournalsSize(); - Configuration copy() throws Exception; Configuration setJournalLockAcquisitionTimeout(long journalLockAcquisitionTimeout); diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java index f951099590..cf6354ae2a 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java @@ -42,8 +42,6 @@ import org.apache.activemq.core.config.DivertConfiguration; import org.apache.activemq.core.config.HAPolicyConfiguration; import org.apache.activemq.core.config.ha.ReplicaPolicyConfiguration; import org.apache.activemq.core.config.ha.ReplicatedPolicyConfiguration; -import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration; -import org.apache.activemq.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.core.security.Role; import org.apache.activemq.core.server.JournalType; import org.apache.activemq.core.server.group.impl.GroupingHandlerConfiguration; @@ -313,21 +311,6 @@ public class ConfigurationImpl implements Configuration return this; } - @Deprecated - @Override - public List getInterceptorClassNames() - { - return getIncomingInterceptorClassNames(); - } - - @Deprecated - @Override - public ConfigurationImpl setInterceptorClassNames(final List interceptors) - { - setIncomingInterceptorClassNames(interceptors); - return this; - } - public List getIncomingInterceptorClassNames() { return incomingInterceptorClassNames; @@ -1117,199 +1100,6 @@ public class ConfigurationImpl implements Configuration return this; } - - /* - * All these operations are now deprecated and may or my not work, best efforts is all we can do, an HA Policy needs to be used - * */ - @Deprecated - public ConfigurationImpl setBackup(final boolean backup) - { - return this; - } - - @Deprecated - public boolean isSharedStore() - { - return haPolicyConfiguration instanceof SharedStoreMasterPolicyConfiguration || haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration; - } - - @Deprecated - public ConfigurationImpl setSharedStore(final boolean sharedStore) - { - return this; - } - - @Deprecated - public long getFailbackDelay() - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - return hapc.getFailbackDelay(); - } - else if (haPolicyConfiguration instanceof SharedStoreMasterPolicyConfiguration) - { - SharedStoreMasterPolicyConfiguration hapc = (SharedStoreMasterPolicyConfiguration) haPolicyConfiguration; - return hapc.getFailbackDelay(); - } - else if (haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfiguration; - return hapc.getFailbackDelay(); - } - return -1; - } - - @Deprecated - public ConfigurationImpl setFailbackDelay(long failbackDelay) - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - hapc.setFailbackDelay(failbackDelay); - } - else if (haPolicyConfiguration instanceof SharedStoreMasterPolicyConfiguration) - { - SharedStoreMasterPolicyConfiguration hapc = (SharedStoreMasterPolicyConfiguration) haPolicyConfiguration; - hapc.setFailbackDelay(failbackDelay); - } - else if (haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfiguration; - hapc.setFailbackDelay(failbackDelay); - } - - return this; - } - - @Deprecated - public String getBackupGroupName() - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - return hapc.getGroupName(); - } - else if (haPolicyConfiguration instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfiguration; - return hapc.getGroupName(); - } - return null; - } - - @Deprecated - public ConfigurationImpl setBackupGroupName(String nodeGroupName) - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - hapc.setGroupName(nodeGroupName); - } - else if (haPolicyConfiguration instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfiguration; - hapc.setGroupName(nodeGroupName); - } - return this; - } - - @Override - @Deprecated - public ConfigurationImpl setReplicationClustername(String clusterName) - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - hapc.setClusterName(clusterName); - } - else if (haPolicyConfiguration instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfiguration; - hapc.setClusterName(clusterName); - } - return this; - } - - @Override - @Deprecated - public String getReplicationClustername() - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - return hapc.getClusterName(); - } - else if (haPolicyConfiguration instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfiguration; - return hapc.getClusterName(); - } - return null; - } - - @Override - @Deprecated - public ConfigurationImpl setMaxSavedReplicatedJournalSize(int maxSavedReplicatedJournalsSize) - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - hapc.setMaxSavedReplicatedJournalsSize(maxSavedReplicatedJournalsSize); - } - - return this; - } - - @Override - @Deprecated - public int getMaxSavedReplicatedJournalsSize() - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - return hapc.getMaxSavedReplicatedJournalsSize(); - } - return -1; - } - - @Deprecated - public boolean isAllowFailBack() - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - return hapc.isAllowFailBack(); - } - else if (haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfiguration; - return hapc.isAllowFailBack(); - } - return false; - } - - @Deprecated - public void setAllowFailBack(boolean allowAutoFailBack) - { - if (haPolicyConfiguration instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfiguration; - hapc.setAllowFailBack(allowAutoFailBack); - } - else if (haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfiguration; - hapc.setAllowFailBack(allowAutoFailBack); - } - } - - @Deprecated - public boolean isBackup() - { - return haPolicyConfiguration instanceof ReplicaPolicyConfiguration || haPolicyConfiguration instanceof SharedStoreSlavePolicyConfiguration; - } - @Override public ConfigurationImpl setResolveProtocols(boolean resolveProtocols) { diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java index 1bf0edb470..996d740b4d 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java @@ -42,7 +42,6 @@ import org.apache.activemq.core.config.Configuration; import org.apache.activemq.core.config.ConnectorServiceConfiguration; import org.apache.activemq.core.config.CoreQueueConfiguration; import org.apache.activemq.core.config.DivertConfiguration; -import org.apache.activemq.core.config.HAPolicyConfiguration; import org.apache.activemq.core.config.ScaleDownConfiguration; import org.apache.activemq.core.config.ha.ColocatedPolicyConfiguration; import org.apache.activemq.core.config.ha.LiveOnlyPolicyConfiguration; @@ -192,253 +191,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil NodeList haPolicyNodes = e.getElementsByTagName("ha-policy"); - boolean containsHAPolicy = false; - if (haPolicyNodes.getLength() > 0) { parseHAPolicyConfiguration((Element) haPolicyNodes.item(0), config); - containsHAPolicy = true; - // remove from the DOM so later when we look for deprecated elements using parameterExists() we don't get false positives - e.removeChild(haPolicyNodes.item(0)); - } - - NodeList elems = e.getElementsByTagName("clustered"); - if (elems != null && elems.getLength() > 0) - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("clustered"); - } - - // these are combined because they are both required for setting the correct HAPolicyConfiguration - if (parameterExists(e, "backup") || parameterExists(e, "shared-store")) - { - boolean backup = getBoolean(e, "backup", false); - boolean sharedStore = getBoolean(e, "shared-store", true); - - if (containsHAPolicy) - { - if (parameterExists(e, "backup")) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("backup"); - } - - if (parameterExists(e, "shared-store")) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("shared-store"); - } - } - else - { - if (parameterExists(e, "backup")) - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("backup"); - } - - if (parameterExists(e, "shared-store")) - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("shared-store"); - } - - if (backup && sharedStore) - { - config.setHAPolicyConfiguration(new SharedStoreSlavePolicyConfiguration()); - } - else if (backup && !sharedStore) - { - config.setHAPolicyConfiguration(new ReplicaPolicyConfiguration()); - } - else if (!backup && sharedStore) - { - config.setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration()); - } - else if (!backup && !sharedStore) - { - config.setHAPolicyConfiguration(new ReplicatedPolicyConfiguration()); - } - } - } - - HAPolicyConfiguration haPolicyConfig = config.getHAPolicyConfiguration(); - - if (parameterExists(e, "check-for-live-server")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("check-for-live-server"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("check-for-live-server"); - - if (haPolicyConfig instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfig; - hapc.setCheckForLiveServer(getBoolean(e, "check-for-live-server", hapc.isCheckForLiveServer())); - } - } - } - - if (parameterExists(e, "allow-failback")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("allow-failback"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("allow-failback"); - - if (haPolicyConfig instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfig; - hapc.setAllowFailBack(getBoolean(e, "allow-failback", hapc.isAllowFailBack())); - } - else if (haPolicyConfig instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfig; - hapc.setAllowFailBack(getBoolean(e, "allow-failback", hapc.isAllowFailBack())); - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("check-for-live-server"); - } - } - } - - if (parameterExists(e, "backup-group-name")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("backup-group-name"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("backup-group-name"); - - if (haPolicyConfig instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfig; - hapc.setGroupName(getString(e, "backup-group-name", hapc.getGroupName(), Validators.NO_CHECK)); - } - else if (haPolicyConfig instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfig; - hapc.setGroupName(getString(e, "backup-group-name", hapc.getGroupName(), Validators.NO_CHECK)); - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("backup-group-name"); - } - } - } - - if (parameterExists(e, "failback-delay")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("failback-delay"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("failback-delay"); - - if (haPolicyConfig instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfig; - hapc.setFailbackDelay(getLong(e, "failback-delay", hapc.getFailbackDelay(), Validators.GT_ZERO)); - } - else if (haPolicyConfig instanceof SharedStoreMasterPolicyConfiguration) - { - SharedStoreMasterPolicyConfiguration hapc = (SharedStoreMasterPolicyConfiguration) haPolicyConfig; - hapc.setFailbackDelay(getLong(e, "failback-delay", hapc.getFailbackDelay(), Validators.GT_ZERO)); - } - else if (haPolicyConfig instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfig; - hapc.setFailbackDelay(getLong(e, "failback-delay", hapc.getFailbackDelay(), Validators.GT_ZERO)); - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failback-delay"); - } - } - } - - if (parameterExists(e, "failover-on-shutdown")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("failover-on-shutdown"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("failover-on-shutdown"); - - if (haPolicyConfig instanceof SharedStoreMasterPolicyConfiguration) - { - SharedStoreMasterPolicyConfiguration hapc = (SharedStoreMasterPolicyConfiguration) haPolicyConfig; - hapc.setFailoverOnServerShutdown(getBoolean(e, "failover-on-shutdown", hapc.isFailoverOnServerShutdown())); - } - else if (haPolicyConfig instanceof SharedStoreSlavePolicyConfiguration) - { - SharedStoreSlavePolicyConfiguration hapc = (SharedStoreSlavePolicyConfiguration) haPolicyConfig; - hapc.setFailoverOnServerShutdown(getBoolean(e, "failover-on-shutdown", hapc.isFailoverOnServerShutdown())); - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failover-on-shutdown"); - } - } - } - - if (parameterExists(e, "replication-clustername")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("replication-clustername"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("replication-clustername"); - - if (haPolicyConfig instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfig; - hapc.setClusterName(getString(e, "replication-clustername", null, Validators.NO_CHECK)); - } - else if (haPolicyConfig instanceof ReplicatedPolicyConfiguration) - { - ReplicatedPolicyConfiguration hapc = (ReplicatedPolicyConfiguration) haPolicyConfig; - hapc.setClusterName(getString(e, "replication-clustername", null, Validators.NO_CHECK)); - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("replication-clustername"); - } - } - } - - if (parameterExists(e, "max-saved-replicated-journals-size")) - { - if (containsHAPolicy) - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("max-saved-replicated-journals-size"); - } - else - { - ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("max-saved-replicated-journals-size"); - - if (haPolicyConfig instanceof ReplicaPolicyConfiguration) - { - ReplicaPolicyConfiguration hapc = (ReplicaPolicyConfiguration) haPolicyConfig; - hapc.setMaxSavedReplicatedJournalsSize(getInteger(e, "max-saved-replicated-journals-size", - hapc.getMaxSavedReplicatedJournalsSize(), Validators.MINUS_ONE_OR_GE_ZERO)); - - } - else - { - ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("max-saved-replicated-journals-size"); - } - } } //if we aren already set then set to default @@ -1435,13 +1190,16 @@ public final class FileConfigurationParser extends XMLConfigurationUtil scaleDownConfiguration.setEnabled(getBoolean(scaleDownElement, "enabled", scaleDownConfiguration.isEnabled())); - String scaleDownDiscoveryGroup = getString(scaleDownElement, "discovery-group", scaleDownConfiguration.getDiscoveryGroup(), Validators.NO_CHECK); + NodeList discoveryGroupRef = scaleDownElement.getElementsByTagName("discovery-group-ref"); - scaleDownConfiguration.setDiscoveryGroup(scaleDownDiscoveryGroup); + if (discoveryGroupRef.item(0) != null) + { + scaleDownConfiguration.setDiscoveryGroup(discoveryGroupRef.item(0).getAttributes().getNamedItem("discovery-group-name").getNodeValue()); + } - String scaleDownDiscoveryGroupName = getString(scaleDownElement, "group-name", scaleDownConfiguration.getGroupName(), Validators.NO_CHECK); + String scaleDownGroupName = getString(scaleDownElement, "group-name", scaleDownConfiguration.getGroupName(), Validators.NO_CHECK); - scaleDownConfiguration.setGroupName(scaleDownDiscoveryGroupName); + scaleDownConfiguration.setGroupName(scaleDownGroupName); NodeList scaleDownConnectorNode = scaleDownElement.getElementsByTagName("connectors"); diff --git a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java index 446b423dab..733d4f38d2 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java @@ -324,29 +324,6 @@ public class QueueControlImpl extends AbstractControl implements QueueControl } } - public void setDeadLetterAddress(final String deadLetterAddress) throws Exception - { - checkStarted(); - - clearIO(); - try - { - AddressSettings addressSettings = addressSettingsRepository.getMatch(address); - - if (addressSettings != null && deadLetterAddress != null) - { - addressSettings = new AddressSettings(addressSettings); - addressSettings.setDeadLetterAddress(SimpleString.toSimpleString(deadLetterAddress)); - addressSettingsRepository.addMatch(address, addressSettings); - } - - } - finally - { - blockOnIO(); - } - } - public String getExpiryAddress() { checkStarted(); @@ -371,29 +348,6 @@ public class QueueControlImpl extends AbstractControl implements QueueControl } } - public void setExpiryAddress(final String expiryAddress) throws Exception - { - checkStarted(); - - clearIO(); - try - { - AddressSettings addressSettings = addressSettingsRepository.getMatch(address); - - if (addressSettings != null && expiryAddress != null) - { - addressSettings = new AddressSettings(addressSettings); - addressSettings.setExpiryAddress(SimpleString.toSimpleString(expiryAddress)); - addressSettingsRepository.addMatch(address, addressSettings); - } - - } - finally - { - blockOnIO(); - } - } - public Map[] listScheduledMessages() throws Exception { checkStarted(); diff --git a/activemq-server/src/main/resources/schema/activemq-configuration.xsd b/activemq-server/src/main/resources/schema/activemq-configuration.xsd index 7e32748d46..7ef6023150 100644 --- a/activemq-server/src/main/resources/schema/activemq-configuration.xsd +++ b/activemq-server/src/main/resources/schema/activemq-configuration.xsd @@ -45,27 +45,6 @@ - - - - DEPRECATED. This option is deprecated and its value will be ignored (HQ221038). A ActiveMQ server will - be "clustered" when its configuration contain a cluster-configuration. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Whether to check the cluster for a (live) server using our own server ID when starting up. This - option is only necessary for performing 'fail-back' on replicating servers. Strictly speaking this - setting only applies to live servers and not to backups. - - - - @@ -158,38 +137,6 @@ - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Name of the cluster configuration to use for replication. This setting is only necessary in case - you configure multiple cluster connections. It is used by a replicating backups and by live servers - that may attempt fail-back. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Name of the cluster configuration to use for scaling down. This setting is only necessary in - case you configure multiple cluster connections. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. This specifies how many times a replicated backup server can restart after moving its files on - start. Once there are this number of backup journal files the server will stop permanently after if - fails back. - - - - @@ -324,16 +271,7 @@ - - - - - DEPRECATED. This option is deprecated, but it will still be honored. Any interceptor specified here - will be considered an "incoming" interceptor. See <remoting-incoming-interceptors> and <remoting-outgoing-interceptors>. - - - - + @@ -352,84 +290,6 @@ - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. It indicates whether this server is a backup server - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Whether a server will automatically stop when a another places a request to take over its place. - The use case is when a regular server stops and its backup takes over its duties, later the main - server restarts and requests the server (the former backup) to stop operating. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. used for replication, if set, (remote) backup servers will only pair with live servers with - matching backup-group-name - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. used for scaling down, if set, a live server will only send messages to another live server with - matching scale-down-group-name - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. The delay to wait before fail-back occurs on (live's) restart. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Will this backup server come live on a normal server shutdown. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. Will this server send its messages to another live server in the - cluster when shut-down cleanly. - - - - - - - - DEPRECATED. This option is deprecated, but it will still be honored if <ha-policy> is not also - used. 'shared-store' applies to live and backup pairs, and it indicates if the live/backup pair share - storage or if the data is replicated among them. - - - - @@ -1995,13 +1855,17 @@ - - - - The discovery group to use for scale down, if not supplied then the scale-down-connectors or first - invm connector will be used - - + + + + + + The discovery group to use for scale down, if not supplied then the scale-down-connectors or first + invm connector will be used + + + + diff --git a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationParserTest.java b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationParserTest.java index 76c4ccdbd1..7aee01be33 100644 --- a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationParserTest.java +++ b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationParserTest.java @@ -138,8 +138,6 @@ public class FileConfigurationParserTest extends UnitTestCase private static String firstPart = "" + "\n" + "ActiveMQ.main.config" + "\n" + - "abackupgroupname" + "\n" + - "ascaledowngroupname" + "\n" + "org.apache.activemq.integration.logging.Log4jLogDelegateFactory" + "\n" + "${jboss.server.data.dir}/activemq/bindings" + "\n" + "${jboss.server.data.dir}/activemq/journal" + "\n" + diff --git a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationTest.java b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationTest.java index 78ca8ce61c..7c1a16698b 100644 --- a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationTest.java +++ b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/FileConfigurationTest.java @@ -241,7 +241,7 @@ public class FileConfigurationTest extends ConfigurationImplTest LiveOnlyPolicyConfiguration lopc = (LiveOnlyPolicyConfiguration) pc; assertNotNull(lopc.getScaleDownConfiguration()); assertEquals(lopc.getScaleDownConfiguration().getGroupName(), "boo!"); - assertEquals(lopc.getScaleDownConfiguration().getDiscoveryGroup(), "wahey"); + assertEquals(lopc.getScaleDownConfiguration().getDiscoveryGroup(), "dg1"); for (ClusterConnectionConfiguration ccc : conf.getClusterConfigurations()) { diff --git a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/WrongRoleFileConfigurationParserTest.java b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/WrongRoleFileConfigurationParserTest.java index 6ef2c1ea86..bfb57e58e5 100644 --- a/activemq-server/src/test/java/org/apache/activemq/core/config/impl/WrongRoleFileConfigurationParserTest.java +++ b/activemq-server/src/test/java/org/apache/activemq/core/config/impl/WrongRoleFileConfigurationParserTest.java @@ -68,7 +68,6 @@ public class WrongRoleFileConfigurationParserTest extends UnitTestCase "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "xsi:schemaLocation=\"urn:activemq /schema/activemq-configuration.xsd\">\n" + "ActiveMQ.main.config" + "\n" + - "anodegroupname" + "\n" + "org.apache.activemq.integration.logging.Log4jLogDelegateFactory" + "\n" + "${jboss.server.data.dir}/activemq/bindings" + "\n" + "${jboss.server.data.dir}/activemq/journal" + "\n" + diff --git a/activemq-server/src/test/resources/ConfigurationTest-full-config.xml b/activemq-server/src/test/resources/ConfigurationTest-full-config.xml index f0a5620c0e..1045e21fd6 100644 --- a/activemq-server/src/test/resources/ConfigurationTest-full-config.xml +++ b/activemq-server/src/test/resources/ConfigurationTest-full-config.xml @@ -21,8 +21,6 @@ SomeNameForUseOnTheApplicationServer false - true - false false 12345 54321 @@ -34,9 +32,6 @@ Whatever Frog 32a10275cf4ab4e9 - cluster-connection1 - cluster-connection2 - 5 org.apache.activemq.utils.DefaultSensitiveStringCodec true com.foo @@ -53,18 +48,14 @@ 8 127 true - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - - true - true - backupGroupName - scaleDownGroupName - 15000 - false - false - false + + + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 + true @@ -185,7 +176,7 @@ boo! - wahey + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest0.xml b/activemq-server/src/test/resources/InvalidConfigurationTest0.xml index 100a3e6dd3..846373c034 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest0.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest0.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest1.xml b/activemq-server/src/test/resources/InvalidConfigurationTest1.xml index 6bfde43e41..9689a058e3 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest1.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest1.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest2.xml b/activemq-server/src/test/resources/InvalidConfigurationTest2.xml index bd9693e87a..d448cb4605 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest2.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest2.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest3.xml b/activemq-server/src/test/resources/InvalidConfigurationTest3.xml index 66e435ab42..4b1de12db2 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest3.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest3.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest4.xml b/activemq-server/src/test/resources/InvalidConfigurationTest4.xml index 29f291e121..a23fc50c70 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest4.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest4.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/InvalidConfigurationTest5.xml b/activemq-server/src/test/resources/InvalidConfigurationTest5.xml index f6f12092ab..7fb062c6ca 100644 --- a/activemq-server/src/test/resources/InvalidConfigurationTest5.xml +++ b/activemq-server/src/test/resources/InvalidConfigurationTest5.xml @@ -31,7 +31,6 @@ Whatever Frog Wombat - cluster-connection1 false gro.qtenroh ocelot @@ -45,8 +44,6 @@ 8 127 true - true - true true pagingdir somedir @@ -68,10 +65,10 @@ 95 54321 - + org.apache.activemq.tests.unit.core.config.impl.TestInterceptor1 org.apache.activemq.tests.unit.core.config.impl.TestInterceptor2 - + diff --git a/activemq-server/src/test/resources/colocated-hapolicy-config.xml b/activemq-server/src/test/resources/colocated-hapolicy-config.xml index 3f401a3685..f1bd7840ab 100644 --- a/activemq-server/src/test/resources/colocated-hapolicy-config.xml +++ b/activemq-server/src/test/resources/colocated-hapolicy-config.xml @@ -19,6 +19,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/activemq-server.xsd"> + + + @@ -41,7 +44,7 @@ boo! - wahey + diff --git a/activemq-server/src/test/resources/live-only-hapolicy-config.xml b/activemq-server/src/test/resources/live-only-hapolicy-config.xml index ee0a377708..e27924e3f0 100644 --- a/activemq-server/src/test/resources/live-only-hapolicy-config.xml +++ b/activemq-server/src/test/resources/live-only-hapolicy-config.xml @@ -19,16 +19,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-server.xsd"> + + + boo! - wahey + - diff --git a/activemq-server/src/test/resources/replica-hapolicy-config.xml b/activemq-server/src/test/resources/replica-hapolicy-config.xml index 8ed633cacd..e6946a9091 100644 --- a/activemq-server/src/test/resources/replica-hapolicy-config.xml +++ b/activemq-server/src/test/resources/replica-hapolicy-config.xml @@ -18,8 +18,10 @@ xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-server.xsd"> - + + + @@ -33,11 +35,10 @@ boo! - wahey + - diff --git a/activemq-server/src/test/resources/shared-store-slave-hapolicy-config.xml b/activemq-server/src/test/resources/shared-store-slave-hapolicy-config.xml index 0f8bb71b32..05b6817c90 100644 --- a/activemq-server/src/test/resources/shared-store-slave-hapolicy-config.xml +++ b/activemq-server/src/test/resources/shared-store-slave-hapolicy-config.xml @@ -19,6 +19,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/activemq-server.xsd"> + + + @@ -30,11 +33,10 @@ boo! - wahey + - diff --git a/docs/user-manual/en/ha.md b/docs/user-manual/en/ha.md index bd12dd4d1b..e9d2742f47 100644 --- a/docs/user-manual/en/ha.md +++ b/docs/user-manual/en/ha.md @@ -554,7 +554,7 @@ this would look like: - my-discovery-group + @@ -612,7 +612,7 @@ typical configuration would look like: boo! - wahey + diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/InterceptorTest.java index 3395e61802..9369cb5e49 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/InterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/InterceptorTest.java @@ -667,7 +667,7 @@ public class InterceptorTest extends ServiceTestBase Assert.assertEquals("orange", message.getStringProperty(InterceptorTest.key)); } - sf.getServerLocator().removeInterceptor(interceptor); + sf.getServerLocator().removeIncomingInterceptor(interceptor); for (int i = 0; i < numMessages; i++) { @@ -982,7 +982,7 @@ public class InterceptorTest extends ServiceTestBase Assert.assertEquals(4, message.getIntProperty("d").intValue()); } - sf.getServerLocator().removeInterceptor(interceptor2); + sf.getServerLocator().removeIncomingInterceptor(interceptor2); for (int i = 0; i < numMessages; i++) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java index e953e83c5e..071e78288c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java @@ -428,7 +428,7 @@ public class HangConsumerTest extends ServiceTestBase HangInterceptor hangInt = new HangInterceptor(); try { - locator.addInterceptor(hangInt); + locator.addIncomingInterceptor(hangInt); ClientSessionFactory factory = locator.createSessionFactory(); ClientSession session = factory.createSession(false, false, false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/failover/ReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/failover/ReplicatedFailoverTest.java index 0e045b7983..8596db3c38 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/failover/ReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/failover/ReplicatedFailoverTest.java @@ -81,7 +81,9 @@ public class ReplicatedFailoverTest extends FailoverTest crash(session); - liveServer.getServer().getConfiguration().setCheckForLiveServer(true); + ReplicatedPolicyConfiguration replicatedPolicyConfiguration = (ReplicatedPolicyConfiguration) liveServer.getServer().getConfiguration().getHAPolicyConfiguration(); + + replicatedPolicyConfiguration.setCheckForLiveServer(true); liveServer.start(); @@ -95,7 +97,9 @@ public class ReplicatedFailoverTest extends FailoverTest crash(session); - liveServer.getServer().getConfiguration().setCheckForLiveServer(true); + replicatedPolicyConfiguration = (ReplicatedPolicyConfiguration) liveServer.getServer().getConfiguration().getHAPolicyConfiguration(); + + replicatedPolicyConfiguration.setCheckForLiveServer(true); liveServer.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java index 52711fc043..5f345e0136 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java @@ -439,7 +439,10 @@ public class JMSQueueControlTest extends ManagementTestBase Assert.assertNull(queueControl.getExpiryAddress()); - queueControl.setExpiryAddress(expiryAddress); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setExpiryAddress(new SimpleString(expiryAddress)); + server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings); + Assert.assertEquals(expiryAddress, queueControl.getExpiryAddress()); } @@ -469,7 +472,11 @@ public class JMSQueueControlTest extends ManagementTestBase String expiryQueueName = RandomUtil.randomString(); ActiveMQQueue expiryQueue = (ActiveMQQueue) ActiveMQJMSClient.createQueue(expiryQueueName); serverManager.createQueue(false, expiryQueueName, null, true, expiryQueueName); - queueControl.setExpiryAddress(expiryQueue.getAddress()); + + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setExpiryAddress(new SimpleString(expiryQueue.getAddress())); + server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings); +// queueControl.setExpiryAddress(expiryQueue.getAddress()); JMSQueueControl expiryQueueControl = ManagementControlHelper.createJMSQueueControl(expiryQueue, mbeanServer); @@ -595,7 +602,10 @@ public class JMSQueueControlTest extends ManagementTestBase Assert.assertNull(queueControl.getDeadLetterAddress()); - queueControl.setDeadLetterAddress(deadLetterAddress); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress)); + server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings); + Assert.assertEquals(deadLetterAddress, queueControl.getDeadLetterAddress()); } @@ -606,6 +616,10 @@ public class JMSQueueControlTest extends ManagementTestBase serverManager.createQueue(false, deadLetterQueue, null, true, deadLetterQueue); ActiveMQQueue dlq = (ActiveMQQueue) ActiveMQJMSClient.createQueue(deadLetterQueue); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setDeadLetterAddress(new SimpleString(dlq.getAddress())); + server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings); + Connection conn = createConnection(); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = sess.createProducer(queue); @@ -623,7 +637,7 @@ public class JMSQueueControlTest extends ManagementTestBase Assert.assertEquals(2, getMessageCount(queueControl)); Assert.assertEquals(0, getMessageCount(dlqControl)); - queueControl.setDeadLetterAddress(dlq.getAddress()); +// queueControl.setDeadLetterAddress(dlq.getAddress()); boolean movedToDeadLetterAddress = queueControl.sendMessageToDeadLetterAddress(message.getJMSMessageID()); Assert.assertTrue(movedToDeadLetterAddress); @@ -669,6 +683,10 @@ public class JMSQueueControlTest extends ManagementTestBase serverManager.createQueue(false, deadLetterQueue, null, true, deadLetterQueue); ActiveMQQueue dlq = (ActiveMQQueue) ActiveMQJMSClient.createQueue(deadLetterQueue); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setDeadLetterAddress(new SimpleString(dlq.getAddress())); + server.getAddressSettingsRepository().addMatch(queue.getAddress(), addressSettings); + Connection conn = createConnection(); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -682,7 +700,7 @@ public class JMSQueueControlTest extends ManagementTestBase Assert.assertEquals(2, getMessageCount(queueControl)); Assert.assertEquals(0, getMessageCount(dlqControl)); - queueControl.setDeadLetterAddress(dlq.getAddress()); +// queueControl.setDeadLetterAddress(dlq.getAddress()); int deadMessageCount = queueControl.sendMessagesToDeadLetterAddress(filter); Assert.assertEquals(1, deadMessageCount); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/management/QueueControlTest.java index 460da62f25..48f7a8e516 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/management/QueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/management/QueueControlTest.java @@ -141,7 +141,10 @@ public class QueueControlTest extends ManagementTestBase session.createQueue(address, queue, null, false); QueueControl queueControl = createManagementControl(address, queue); - queueControl.setDeadLetterAddress(deadLetterAddress); + + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress)); + server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings); Assert.assertEquals(deadLetterAddress, queueControl.getDeadLetterAddress()); @@ -186,7 +189,10 @@ public class QueueControlTest extends ManagementTestBase session.createQueue(address, queue, null, false); QueueControl queueControl = createManagementControl(address, queue); - queueControl.setExpiryAddress(expiryAddress); + + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setExpiryAddress(new SimpleString(expiryAddress)); + server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings); Assert.assertEquals(expiryAddress, queueControl.getExpiryAddress()); @@ -1425,7 +1431,10 @@ public class QueueControlTest extends ManagementTestBase Assert.assertEquals(1, messages.length); long messageID = (Long) messages[0].get("messageID"); - queueControl.setExpiryAddress(expiryAddress.toString()); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setExpiryAddress(expiryAddress); + server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings); + boolean expired = queueControl.expireMessage(messageID); Assert.assertTrue(expired); Assert.assertEquals(0, getMessageCount(queueControl)); @@ -1464,7 +1473,9 @@ public class QueueControlTest extends ManagementTestBase Assert.assertEquals(2, messages.length); long messageID = (Long) messages[0].get("messageID"); - queueControl.setDeadLetterAddress(deadLetterAddress.toString()); + AddressSettings addressSettings = new AddressSettings(); + addressSettings.setDeadLetterAddress(deadLetterAddress); + server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings); Assert.assertEquals(0, getMessageCount(deadLetterQueueControl)); boolean movedToDeadLetterAddress = queueControl.sendMessageToDeadLetterAddress(messageID);