This closes #209

This commit is contained in:
jbertram 2015-10-21 15:55:12 -05:00
commit 2d3177a45b
8 changed files with 32 additions and 34 deletions

View File

@ -16,6 +16,11 @@
*/ */
package org.apache.activemq.artemis.core.server.cluster.ha; package org.apache.activemq.artemis.core.server.cluster.ha;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.artemis.api.core.Pair; import org.apache.activemq.artemis.api.core.Pair;
import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.TransportConfiguration;
@ -27,11 +32,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.cluster.ClusterControl; import org.apache.activemq.artemis.core.server.cluster.ClusterControl;
import org.apache.activemq.artemis.core.server.cluster.ClusterController; import org.apache.activemq.artemis.core.server.cluster.ClusterController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ColocatedHAManager implements HAManager { public class ColocatedHAManager implements HAManager {
private final ColocatedPolicy haPolicy; private final ColocatedPolicy haPolicy;
@ -129,7 +129,7 @@ public class ColocatedHAManager implements HAManager {
return clusterControl.requestReplicatedBackup(backupSize, server.getNodeID()); return clusterControl.requestReplicatedBackup(backupSize, server.getNodeID());
} }
else { else {
return clusterControl.requestSharedStoreBackup(backupSize, server.getConfiguration().getJournalDirectory(), server.getConfiguration().getBindingsDirectory(), server.getConfiguration().getLargeMessagesDirectory(), server.getConfiguration().getPagingDirectory()); return clusterControl.requestSharedStoreBackup(backupSize, server.getConfiguration().getJournalLocation().getAbsolutePath(), server.getConfiguration().getBindingsLocation().getAbsolutePath(), server.getConfiguration().getLargeMessagesLocation().getAbsolutePath(), server.getConfiguration().getPagingLocation().getAbsolutePath());
} }
} }

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.activemq.artemis.jms.example; package org.apache.activemq.artemis.jms.example;
import org.apache.activemq.artemis.util.ServerUtil;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer; import javax.jms.MessageConsumer;
@ -28,6 +26,8 @@ import javax.jms.TextMessage;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import java.util.Hashtable; import java.util.Hashtable;
import org.apache.activemq.artemis.util.ServerUtil;
/** /**
* A simple example that demonstrates server side load-balancing of messages between the queue instances on different * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
* nodes of the cluster. * nodes of the cluster.
@ -51,6 +51,8 @@ public class ColocatedFailoverScaleDownExample {
server0 = ServerUtil.startServer(args[0], ColocatedFailoverScaleDownExample.class.getSimpleName() + "0", 0, 5000); server0 = ServerUtil.startServer(args[0], ColocatedFailoverScaleDownExample.class.getSimpleName() + "0", 0, 5000);
server1 = ServerUtil.startServer(args[1], ColocatedFailoverScaleDownExample.class.getSimpleName() + "1", 1, 5000); server1 = ServerUtil.startServer(args[1], ColocatedFailoverScaleDownExample.class.getSimpleName() + "1", 1, 5000);
Thread.sleep(3000);
// Step 1. Get an initial context for looking up JNDI for both servers // Step 1. Get an initial context for looking up JNDI for both servers
Hashtable<String, Object> properties = new Hashtable<String, Object>(); Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");

View File

@ -29,13 +29,13 @@ under the License.
<core xmlns="urn:activemq:core"> <core xmlns="urn:activemq:core">
<bindings-directory>${data.dir:../data}/bindings</bindings-directory> <bindings-directory>./data/bindings</bindings-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory> <journal-directory>./data/journal</journal-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory> <large-messages-directory>./data/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory> <paging-directory>./data/paging</paging-directory>
<!-- Connectors --> <!-- Connectors -->
<connectors> <connectors>

View File

@ -29,13 +29,13 @@ under the License.
<core xmlns="urn:activemq:core"> <core xmlns="urn:activemq:core">
<bindings-directory>${data.dir:../data}/bindings</bindings-directory> <bindings-directory>./data/bindings</bindings-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory> <journal-directory>./data/journal</journal-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory> <large-messages-directory>./data/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory> <paging-directory>./data/paging</paging-directory>
<!-- Connectors --> <!-- Connectors -->
<connectors> <connectors>

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.activemq.artemis.jms.example; package org.apache.activemq.artemis.jms.example;
import org.apache.activemq.artemis.util.ServerUtil;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer; import javax.jms.MessageConsumer;
@ -28,6 +26,8 @@ import javax.jms.TextMessage;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import java.util.Hashtable; import java.util.Hashtable;
import org.apache.activemq.artemis.util.ServerUtil;
/** /**
* A simple example that demonstrates a colocated server * A simple example that demonstrates a colocated server
*/ */
@ -50,6 +50,8 @@ public class ColocatedFailoverExample {
server0 = ServerUtil.startServer(args[0], ColocatedFailoverExample.class.getSimpleName() + "0", 0, 5000); server0 = ServerUtil.startServer(args[0], ColocatedFailoverExample.class.getSimpleName() + "0", 0, 5000);
server1 = ServerUtil.startServer(args[1], ColocatedFailoverExample.class.getSimpleName() + "1", 1, 5000); server1 = ServerUtil.startServer(args[1], ColocatedFailoverExample.class.getSimpleName() + "1", 1, 5000);
Thread.sleep(3000);
// Step 1. Get an initial context for looking up JNDI for both servers // Step 1. Get an initial context for looking up JNDI for both servers
Hashtable<String, Object> properties = new Hashtable<String, Object>(); Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");

View File

@ -29,13 +29,13 @@ under the License.
<core xmlns="urn:activemq:core"> <core xmlns="urn:activemq:core">
<bindings-directory>${data.dir:../data}/bindings</bindings-directory> <bindings-directory>./data/bindings</bindings-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory> <journal-directory>./data/journal</journal-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory> <large-messages-directory>./data/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory> <paging-directory>./data/paging</paging-directory>
<!-- Connectors --> <!-- Connectors -->
<connectors> <connectors>

View File

@ -29,13 +29,13 @@ under the License.
<core xmlns="urn:activemq:core"> <core xmlns="urn:activemq:core">
<bindings-directory>${data.dir:../data}/bindings</bindings-directory> <bindings-directory>./data/bindings</bindings-directory>
<journal-directory>${data.dir:../data}/journal</journal-directory> <journal-directory>./data/journal</journal-directory>
<large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory> <large-messages-directory>./data/largemessages</large-messages-directory>
<paging-directory>${data.dir:../data}/paging</paging-directory> <paging-directory>./data/paging</paging-directory>
<!-- Connectors --> <!-- Connectors -->
<connectors> <connectors>

View File

@ -69,20 +69,14 @@ under the License.
<modules> <modules>
<module>application-layer-failover</module> <module>application-layer-failover</module>
<module>client-side-failoverlistener</module> <module>client-side-failoverlistener</module>
<!-- ARTEMIS-197 FIX ME:
<module>colocated-failover</module> <module>colocated-failover</module>
<module>colocated-failover-scale-down</module> --> <module>colocated-failover-scale-down</module>
<module>ha-policy-autobackup</module> <module>ha-policy-autobackup</module>
<module>multiple-failover</module> <module>multiple-failover</module>
<module>multiple-failover-failback</module> <module>multiple-failover-failback</module>
<module>non-transaction-failover</module> <module>non-transaction-failover</module>
<!-- ARTEMIS-197 FIX ME:
<module>replicated-failback</module> <module>replicated-failback</module>
<module>replicated-failback-static</module> --> <module>replicated-failback-static</module>
<module>replicated-multiple-failover</module> <module>replicated-multiple-failover</module>
<module>replicated-transaction-failover</module> <module>replicated-transaction-failover</module>
<module>scale-down</module> <module>scale-down</module>