This closes #13 Server Load Balancing
This commit is contained in:
commit
4b5bf5cc5d
|
@ -339,9 +339,11 @@ public final class ActiveMQDefaultConfiguration
|
|||
// should duplicate detection headers be inserted in forwarded messages?
|
||||
private static boolean DEFAULT_CLUSTER_DUPLICATE_DETECTION = true;
|
||||
|
||||
// should messages be load balanced if there are no matching consumers on target?
|
||||
private static boolean DEFAULT_CLUSTER_FORWARD_WHEN_NO_CONSUMERS = false;
|
||||
|
||||
// how should messages be load balanced?
|
||||
private static String DEFAULT_CLUSTER_MESSAGE_LOAD_BALANCING_TYPE = "ON_DEMAND";
|
||||
|
||||
// maximum number of hops cluster topology is propagated
|
||||
private static int DEFAULT_CLUSTER_MAX_HOPS = 1;
|
||||
|
||||
|
@ -950,14 +952,19 @@ public final class ActiveMQDefaultConfiguration
|
|||
return DEFAULT_CLUSTER_DUPLICATE_DETECTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* should messages be load balanced if there are no matching consumers on target?
|
||||
*/
|
||||
public static boolean isDefaultClusterForwardWhenNoConsumers()
|
||||
{
|
||||
return DEFAULT_CLUSTER_FORWARD_WHEN_NO_CONSUMERS;
|
||||
}
|
||||
|
||||
/**
|
||||
* should messages be load balanced if there are no matching consumers on target?
|
||||
*/
|
||||
public static String getDefaultClusterMessageLoadBalancingType()
|
||||
{
|
||||
return DEFAULT_CLUSTER_MESSAGE_LOAD_BALANCING_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* maximum number of hops cluster topology is propagated
|
||||
*/
|
||||
|
|
|
@ -46,7 +46,7 @@ public interface ClusterConnectionControl extends ActiveMQComponentControl
|
|||
/**
|
||||
* Return whether this cluster connection forward messages when it has no local consumers.
|
||||
*/
|
||||
boolean isForwardWhenNoConsumers();
|
||||
String getMessageLoadBalancingType();
|
||||
|
||||
/**
|
||||
* Return the Topology that this Cluster Connection knows about
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.core.config;
|
||||
|
||||
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
||||
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
||||
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
|
||||
|
||||
public final class ClusterConnectionConfiguration implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 8948303813427795935L;
|
||||
|
@ -53,7 +54,7 @@ public final class ClusterConnectionConfiguration implements Serializable
|
|||
|
||||
private boolean duplicateDetection = ActiveMQDefaultConfiguration.isDefaultClusterDuplicateDetection();
|
||||
|
||||
private boolean forwardWhenNoConsumers = ActiveMQDefaultConfiguration.isDefaultClusterForwardWhenNoConsumers();
|
||||
private MessageLoadBalancingType messageLoadBalancingType = Enum.valueOf(MessageLoadBalancingType.class, ActiveMQDefaultConfiguration.getDefaultClusterMessageLoadBalancingType());
|
||||
|
||||
private List<String> staticConnectors = Collections.emptyList();
|
||||
|
||||
|
@ -171,9 +172,9 @@ public final class ClusterConnectionConfiguration implements Serializable
|
|||
return duplicateDetection;
|
||||
}
|
||||
|
||||
public boolean isForwardWhenNoConsumers()
|
||||
public MessageLoadBalancingType getMessageLoadBalancingType()
|
||||
{
|
||||
return forwardWhenNoConsumers;
|
||||
return messageLoadBalancingType;
|
||||
}
|
||||
|
||||
public int getMaxHops()
|
||||
|
@ -345,11 +346,12 @@ public final class ClusterConnectionConfiguration implements Serializable
|
|||
}
|
||||
|
||||
/**
|
||||
* @param forwardWhenNoConsumers the forwardWhenNoConsumers to set
|
||||
* @param messageLoadBalancingType
|
||||
* @return
|
||||
*/
|
||||
public ClusterConnectionConfiguration setForwardWhenNoConsumers(boolean forwardWhenNoConsumers)
|
||||
public ClusterConnectionConfiguration setMessageLoadBalancingType(MessageLoadBalancingType messageLoadBalancingType)
|
||||
{
|
||||
this.forwardWhenNoConsumers = forwardWhenNoConsumers;
|
||||
this.messageLoadBalancingType = messageLoadBalancingType;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -395,7 +397,7 @@ public final class ClusterConnectionConfiguration implements Serializable
|
|||
result = prime * result + ((connectorName == null) ? 0 : connectorName.hashCode());
|
||||
result = prime * result + ((discoveryGroupName == null) ? 0 : discoveryGroupName.hashCode());
|
||||
result = prime * result + (duplicateDetection ? 1231 : 1237);
|
||||
result = prime * result + (forwardWhenNoConsumers ? 1231 : 1237);
|
||||
result = prime * result + (messageLoadBalancingType == null ? 0 : messageLoadBalancingType.hashCode());
|
||||
result = prime * result + maxHops;
|
||||
result = prime * result + (int)(maxRetryInterval ^ (maxRetryInterval >>> 32));
|
||||
result = prime * result + minLargeMessageSize;
|
||||
|
@ -459,7 +461,7 @@ public final class ClusterConnectionConfiguration implements Serializable
|
|||
return false;
|
||||
if (duplicateDetection != other.duplicateDetection)
|
||||
return false;
|
||||
if (forwardWhenNoConsumers != other.forwardWhenNoConsumers)
|
||||
if (messageLoadBalancingType != other.messageLoadBalancingType)
|
||||
return false;
|
||||
if (maxHops != other.maxHops)
|
||||
return false;
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.activemq.artemis.core.config.impl;
|
|||
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
|
||||
import org.apache.activemq.artemis.core.server.JournalType;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
|
||||
import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
|
||||
|
||||
|
@ -176,10 +177,24 @@ public final class Validators
|
|||
{
|
||||
String val = (String) value;
|
||||
if (val == null || !val.equals(SlowConsumerPolicy.KILL.toString()) &&
|
||||
!val.equals(SlowConsumerPolicy.NOTIFY.toString()))
|
||||
!val.equals(SlowConsumerPolicy.NOTIFY.toString()))
|
||||
{
|
||||
throw ActiveMQMessageBundle.BUNDLE.invalidSlowConsumerPolicyType(val);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static final Validator MESSAGE_LOAD_BALANCING_TYPE = new Validator()
|
||||
{
|
||||
public void validate(final String name, final Object value)
|
||||
{
|
||||
String val = (String) value;
|
||||
if (val == null || !val.equals(MessageLoadBalancingType.OFF.toString()) &&
|
||||
!val.equals(MessageLoadBalancingType.STRICT.toString()) &&
|
||||
!val.equals(MessageLoadBalancingType.ON_DEMAND.toString()))
|
||||
{
|
||||
throw ActiveMQMessageBundle.BUNDLE.invalidMessageLoadBalancingType(val);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,16 +16,6 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.core.deployers.impl;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
||||
import org.apache.activemq.artemis.api.core.BroadcastEndpointFactory;
|
||||
import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
|
||||
|
@ -56,6 +46,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalConstants;
|
|||
import org.apache.activemq.artemis.core.security.Role;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||
import org.apache.activemq.artemis.core.server.JournalType;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
|
@ -73,6 +64,16 @@ import org.w3c.dom.NamedNodeMap;
|
|||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Parses an XML document according to the {@literal artemis-configuration.xsd} schema.
|
||||
*/
|
||||
|
@ -1159,7 +1160,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
|
|||
configuration.setClusterName(getString(policyNode, "cluster-name", configuration.getClusterName(), Validators.NO_CHECK));
|
||||
|
||||
configuration.setMaxSavedReplicatedJournalsSize(getInteger(policyNode, "max-saved-replicated-journals-size",
|
||||
configuration.getMaxSavedReplicatedJournalsSize(), Validators.MINUS_ONE_OR_GE_ZERO));
|
||||
configuration.getMaxSavedReplicatedJournalsSize(), Validators.MINUS_ONE_OR_GE_ZERO));
|
||||
|
||||
configuration.setScaleDownConfiguration(parseScaleDownConfig(policyNode));
|
||||
|
||||
|
@ -1430,9 +1431,29 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
|
|||
boolean duplicateDetection =
|
||||
getBoolean(e, "use-duplicate-detection", ActiveMQDefaultConfiguration.isDefaultClusterDuplicateDetection());
|
||||
|
||||
boolean forwardWhenNoConsumers =
|
||||
getBoolean(e, "forward-when-no-consumers",
|
||||
ActiveMQDefaultConfiguration.isDefaultClusterForwardWhenNoConsumers());
|
||||
MessageLoadBalancingType messageLoadBalancingType;
|
||||
|
||||
if (parameterExists(e, "forward-when-no-consumers"))
|
||||
{
|
||||
boolean forwardWhenNoConsumers = getBoolean(e, "forward-when-no-consumers",
|
||||
ActiveMQDefaultConfiguration.isDefaultClusterForwardWhenNoConsumers());
|
||||
if (forwardWhenNoConsumers)
|
||||
{
|
||||
messageLoadBalancingType = MessageLoadBalancingType.STRICT;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageLoadBalancingType = MessageLoadBalancingType.ON_DEMAND;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
messageLoadBalancingType = Enum.valueOf(MessageLoadBalancingType.class,
|
||||
getString(e, "message-load-balancing",
|
||||
ActiveMQDefaultConfiguration.getDefaultClusterMessageLoadBalancingType(),
|
||||
Validators.MESSAGE_LOAD_BALANCING_TYPE));
|
||||
}
|
||||
|
||||
int maxHops = getInteger(e, "max-hops",
|
||||
ActiveMQDefaultConfiguration.getDefaultClusterMaxHops(),
|
||||
|
@ -1519,7 +1540,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
|
|||
.setCallTimeout(callTimeout)
|
||||
.setCallFailoverTimeout(callFailoverTimeout)
|
||||
.setDuplicateDetection(duplicateDetection)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(confirmationWindowSize)
|
||||
.setAllowDirectConnectionsOnly(allowDirectConnectionsOnly)
|
||||
|
|
|
@ -194,12 +194,12 @@ public class ClusterConnectionControlImpl extends AbstractControl implements Clu
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isForwardWhenNoConsumers()
|
||||
public String getMessageLoadBalancingType()
|
||||
{
|
||||
clearIO();
|
||||
try
|
||||
{
|
||||
return configuration.isForwardWhenNoConsumers();
|
||||
return configuration.getMessageLoadBalancingType().getType();
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Collection;
|
|||
import org.apache.activemq.artemis.core.server.Queue;
|
||||
import org.apache.activemq.artemis.core.server.RoutingContext;
|
||||
import org.apache.activemq.artemis.core.server.ServerMessage;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.UnproposalListener;
|
||||
|
||||
public interface Bindings extends UnproposalListener
|
||||
|
@ -31,7 +32,7 @@ public interface Bindings extends UnproposalListener
|
|||
|
||||
void removeBinding(Binding binding);
|
||||
|
||||
void setRouteWhenNoConsumers(boolean takePriorityIntoAccount);
|
||||
void setMessageLoadBalancingType(MessageLoadBalancingType messageLoadBalancingType);
|
||||
|
||||
boolean redistribute(ServerMessage message, Queue originatingQueue, RoutingContext context) throws Exception;
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.apache.activemq.artemis.core.server.Queue;
|
|||
import org.apache.activemq.artemis.core.server.RoutingContext;
|
||||
import org.apache.activemq.artemis.core.server.ServerMessage;
|
||||
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.GroupingHandler;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.Proposal;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.Response;
|
||||
|
@ -58,7 +59,7 @@ public final class BindingsImpl implements Bindings
|
|||
|
||||
private final List<Binding> exclusiveBindings = new CopyOnWriteArrayList<Binding>();
|
||||
|
||||
private volatile boolean routeWhenNoConsumers;
|
||||
private volatile MessageLoadBalancingType messageLoadBalancingType = MessageLoadBalancingType.OFF;
|
||||
|
||||
private final GroupingHandler groupingHandler;
|
||||
|
||||
|
@ -73,9 +74,9 @@ public final class BindingsImpl implements Bindings
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public void setRouteWhenNoConsumers(final boolean routeWhenNoConsumers)
|
||||
public void setMessageLoadBalancingType(final MessageLoadBalancingType messageLoadBalancingType)
|
||||
{
|
||||
this.routeWhenNoConsumers = routeWhenNoConsumers;
|
||||
this.messageLoadBalancingType = messageLoadBalancingType;
|
||||
}
|
||||
|
||||
public Collection<Binding> getBindings()
|
||||
|
@ -164,7 +165,7 @@ public final class BindingsImpl implements Bindings
|
|||
|
||||
public boolean redistribute(final ServerMessage message, final Queue originatingQueue, final RoutingContext context) throws Exception
|
||||
{
|
||||
if (routeWhenNoConsumers)
|
||||
if (messageLoadBalancingType.equals(MessageLoadBalancingType.STRICT) || messageLoadBalancingType.equals(MessageLoadBalancingType.OFF))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -409,7 +410,7 @@ public final class BindingsImpl implements Bindings
|
|||
{
|
||||
// bindings.length == 1 ==> only a local queue so we don't check for matching consumers (it's an
|
||||
// unnecessary overhead)
|
||||
if (length == 1 || (binding.isConnected() && (routeWhenNoConsumers || binding.isHighAcceptPriority(message))))
|
||||
if (length == 1 || (binding.isConnected() && (messageLoadBalancingType.equals(MessageLoadBalancingType.STRICT) || binding.isHighAcceptPriority(message))))
|
||||
{
|
||||
theBinding = binding;
|
||||
|
||||
|
@ -421,7 +422,7 @@ public final class BindingsImpl implements Bindings
|
|||
{
|
||||
//https://issues.jboss.org/browse/HORNETQ-1254 When !routeWhenNoConsumers,
|
||||
// the localQueue should always have the priority over the secondary bindings
|
||||
if (lastLowPriorityBinding == -1 || !routeWhenNoConsumers && binding instanceof LocalQueueBinding)
|
||||
if (lastLowPriorityBinding == -1 || messageLoadBalancingType.equals(MessageLoadBalancingType.ON_DEMAND) && binding instanceof LocalQueueBinding)
|
||||
{
|
||||
lastLowPriorityBinding = pos;
|
||||
}
|
||||
|
@ -466,6 +467,11 @@ public final class BindingsImpl implements Bindings
|
|||
{
|
||||
routingNamePositions.put(routingName, pos);
|
||||
}
|
||||
|
||||
if (messageLoadBalancingType.equals(MessageLoadBalancingType.OFF) && theBinding instanceof RemoteQueueBinding)
|
||||
{
|
||||
theBinding = getNextBinding(message, routingName, bindings);
|
||||
}
|
||||
return theBinding;
|
||||
}
|
||||
|
||||
|
|
|
@ -362,4 +362,7 @@ public interface ActiveMQMessageBundle
|
|||
|
||||
@Message(id = 119112, value = "Cannot set MBeanServer during startup or while started")
|
||||
IllegalStateException cannotSetMBeanserver();
|
||||
|
||||
@Message(id = 119113, value = "Invalid message load balancing type {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
IllegalArgumentException invalidMessageLoadBalancingType(String val);
|
||||
}
|
||||
|
|
|
@ -733,7 +733,7 @@ public final class ClusterManager implements ActiveMQComponent
|
|||
config.getCallTimeout(),
|
||||
config.getCallFailoverTimeout(),
|
||||
config.isDuplicateDetection(),
|
||||
config.isForwardWhenNoConsumers(),
|
||||
config.getMessageLoadBalancingType(),
|
||||
config.getConfirmationWindowSize(),
|
||||
executorFactory,
|
||||
server,
|
||||
|
@ -775,7 +775,7 @@ public final class ClusterManager implements ActiveMQComponent
|
|||
config.getCallTimeout(),
|
||||
config.getCallFailoverTimeout(),
|
||||
config.isDuplicateDetection(),
|
||||
config.isForwardWhenNoConsumers(),
|
||||
config.getMessageLoadBalancingType(),
|
||||
config.getConfirmationWindowSize(),
|
||||
executorFactory,
|
||||
server,
|
||||
|
|
|
@ -109,7 +109,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
|
||||
private final boolean useDuplicateDetection;
|
||||
|
||||
private final boolean routeWhenNoConsumers;
|
||||
private final MessageLoadBalancingType messageLoadBalancingType;
|
||||
|
||||
private final int confirmationWindowSize;
|
||||
|
||||
|
@ -177,7 +177,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
final long callTimeout,
|
||||
final long callFailoverTimeout,
|
||||
final boolean useDuplicateDetection,
|
||||
final boolean routeWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int confirmationWindowSize,
|
||||
final ExecutorFactory executorFactory,
|
||||
final ActiveMQServer server,
|
||||
|
@ -216,7 +216,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
|
||||
this.useDuplicateDetection = useDuplicateDetection;
|
||||
|
||||
this.routeWhenNoConsumers = routeWhenNoConsumers;
|
||||
this.messageLoadBalancingType = messageLoadBalancingType;
|
||||
|
||||
this.confirmationWindowSize = confirmationWindowSize;
|
||||
|
||||
|
@ -284,7 +284,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
final long callTimeout,
|
||||
final long callFailoverTimeout,
|
||||
final boolean useDuplicateDetection,
|
||||
final boolean routeWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int confirmationWindowSize,
|
||||
final ExecutorFactory executorFactory,
|
||||
final ActiveMQServer server,
|
||||
|
@ -329,7 +329,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
|
||||
this.useDuplicateDetection = useDuplicateDetection;
|
||||
|
||||
this.routeWhenNoConsumers = routeWhenNoConsumers;
|
||||
this.messageLoadBalancingType = messageLoadBalancingType;
|
||||
|
||||
this.confirmationWindowSize = confirmationWindowSize;
|
||||
|
||||
|
@ -1388,7 +1388,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
|
||||
Bindings theBindings = postOffice.getBindingsForAddress(queueAddress);
|
||||
|
||||
theBindings.setRouteWhenNoConsumers(routeWhenNoConsumers);
|
||||
theBindings.setMessageLoadBalancingType(messageLoadBalancingType);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.core.server.cluster.impl;
|
||||
|
||||
public enum MessageLoadBalancingType
|
||||
{
|
||||
OFF("OFF"), STRICT("STRICT"), ON_DEMAND("ON_DEMAND");
|
||||
|
||||
private String type;
|
||||
|
||||
MessageLoadBalancingType(final String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
|
@ -1223,11 +1223,27 @@
|
|||
<xsd:element name="forward-when-no-consumers" type="xsd:boolean" default="false" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
should messages be load balanced if there are no matching consumers on target?
|
||||
DEPRECATED: use message-load-balancing-type instead. Select STRICT to mimic foward-when-no-consumers=true
|
||||
and ON_DEMAND to mimic forward-when-no-consumers=false.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="message-load-balancing" default="ON_DEMAND" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
how should messages be load balanced between servers in a cluster?
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="OFF"/>
|
||||
<xsd:enumeration value="STRICT"/>
|
||||
<xsd:enumeration value="ON_DEMAND"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="max-hops" type="xsd:int" default="1" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
|
|||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
||||
import org.apache.activemq.artemis.core.security.Role;
|
||||
import org.apache.activemq.artemis.core.server.JournalType;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -260,7 +261,7 @@ public class FileConfigurationTest extends ConfigurationImplTest
|
|||
Assert.assertEquals("queues1", ccc.getAddress());
|
||||
Assert.assertEquals(3, ccc.getRetryInterval());
|
||||
Assert.assertEquals(true, ccc.isDuplicateDetection());
|
||||
Assert.assertEquals(false, ccc.isForwardWhenNoConsumers());
|
||||
Assert.assertEquals(MessageLoadBalancingType.ON_DEMAND, ccc.getMessageLoadBalancingType());
|
||||
Assert.assertEquals(1, ccc.getMaxHops());
|
||||
Assert.assertEquals(123, ccc.getCallTimeout());
|
||||
Assert.assertEquals(123, ccc.getCallFailoverTimeout());
|
||||
|
@ -279,7 +280,7 @@ public class FileConfigurationTest extends ConfigurationImplTest
|
|||
Assert.assertEquals(456, ccc.getCallTimeout());
|
||||
Assert.assertEquals(456, ccc.getCallFailoverTimeout());
|
||||
Assert.assertEquals(false, ccc.isDuplicateDetection());
|
||||
Assert.assertEquals(true, ccc.isForwardWhenNoConsumers());
|
||||
Assert.assertEquals(MessageLoadBalancingType.STRICT, ccc.getMessageLoadBalancingType());
|
||||
Assert.assertEquals(2, ccc.getMaxHops());
|
||||
Assert.assertEquals(Collections.emptyList(), ccc.getStaticConnectors());
|
||||
Assert.assertEquals("dg1", ccc.getDiscoveryGroupName());
|
||||
|
|
|
@ -109,6 +109,7 @@ import org.apache.activemq.artemis.core.server.ServerMessage;
|
|||
import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
|
||||
import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
|
||||
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.impl.Activation;
|
||||
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
|
||||
import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
|
||||
|
@ -525,9 +526,9 @@ public abstract class ActiveMQTestBase extends Assert
|
|||
.setConnectorName(connectorName)
|
||||
.setRetryInterval(1000)
|
||||
.setDuplicateDetection(false)
|
||||
.setForwardWhenNoConsumers(true)
|
||||
.setMaxHops(1)
|
||||
.setConfirmationWindowSize(1)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.STRICT)
|
||||
.setStaticConnectors(connectors0);
|
||||
|
||||
return clusterConnectionConfiguration;
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<resolve-protocols>false</resolve-protocols>
|
||||
|
@ -65,16 +65,16 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor>tcp://0.0.0.0:61616?tcpNoDelay=456;connectionTtl=44;connectionsAllowed=92</acceptor>
|
||||
<acceptor>vm://0?e1=z1;e2=567;connectionsAllowed=87</acceptor>
|
||||
<acceptor>vm://0?e1=z1;e2=567;connectionsAllowed=87</acceptor>
|
||||
</acceptors>
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -118,38 +118,38 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<ha-policy>
|
||||
|
@ -167,35 +167,35 @@
|
|||
</ha-policy>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
<grouping-handler name="gh1">
|
||||
|
@ -225,7 +225,7 @@
|
|||
<memory-warning-threshold>95</memory-warning-threshold>
|
||||
<memory-measure-interval>54321</memory-measure-interval>
|
||||
<large-messages-directory>largemessagesdir</large-messages-directory>
|
||||
<security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -76,17 +76,17 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor name="acceptor1">tcp://localhost:61616</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -130,102 +130,102 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>AA</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>AA</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
</configuration>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -76,17 +76,17 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor name="acceptor1">tcp://localhost:61616</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -130,102 +130,102 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
</configuration>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -76,17 +76,17 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor name="acceptor1">tcp://localhost:61616</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -130,103 +130,103 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
|
||||
</configuration>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -80,13 +80,13 @@
|
|||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -131,102 +131,102 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
</configuration>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -76,17 +76,17 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor name="acceptor1">tcp://localhost:61616</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -130,101 +130,101 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
</configuration>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<configuration
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq ../../src/config/common/schema/artemis-server.xsd">
|
||||
<core xmlns="urn:activemq:core">
|
||||
<name>SomeNameForUseOnTheApplicationServer</name>
|
||||
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
|
||||
|
@ -76,17 +76,17 @@
|
|||
</connectors>
|
||||
<acceptors>
|
||||
<acceptor name="acceptor1">tcp://localhost:61616</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
<acceptor name="acceptor2">vm://0</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-group name="bg1">
|
||||
<local-bind-port>10999</local-bind-port>
|
||||
<group-address>192.168.0.120</group-address>
|
||||
<group-port>11999</group-port>
|
||||
<broadcast-period>12345</broadcast-period>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-group>
|
||||
<broadcast-group name="bg2">
|
||||
<local-bind-port>12999</local-bind-port>
|
||||
<group-address>192.168.0.121</group-address>
|
||||
|
@ -130,104 +130,104 @@
|
|||
<queues>
|
||||
<queue name="queue1">
|
||||
<address>address1</address>
|
||||
<filter string="color='red'" />
|
||||
<filter string="color='red'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
<queue name="queue2">
|
||||
<address>address2</address>
|
||||
<filter string="color='blue'" />
|
||||
<filter string="color='blue'"/>
|
||||
<durable>false</durable>
|
||||
</queue>
|
||||
</queues>
|
||||
<bridges>
|
||||
<bridge name="bridge1">
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<queue-name>queue1</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address1</forwarding-address>
|
||||
<filter string="sku > 1"/>
|
||||
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
|
||||
<min-large-message-size>4</min-large-message-size>
|
||||
<check-period>31</check-period>
|
||||
<connection-ttl>370</connection-ttl>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.2</retry-interval-multiplier>
|
||||
<max-retry-interval>10002</max-retry-interval>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<reconnect-attempts>2</reconnect-attempts>
|
||||
<failover-on-server-shutdown>false</failover-on-server-shutdown>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
</static-connectors>
|
||||
</static-connectors>
|
||||
</bridge>
|
||||
<bridge name="bridge2">
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<queue-name>queue2</queue-name>
|
||||
<forwarding-address>bridge-forwarding-address2</forwarding-address>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</bridge>
|
||||
</bridges>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="cluster-connection1">
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<address>queues1</address>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
<check-period>331</check-period>
|
||||
<connection-ttl>3370</connection-ttl>
|
||||
<min-large-message-size>321</min-large-message-size>
|
||||
<call-timeout>123</call-timeout>
|
||||
<retry-interval>3</retry-interval>
|
||||
<retry-interval-multiplier>0.25</retry-interval-multiplier>
|
||||
<max-retry-interval>10000</max-retry-interval>
|
||||
<reconnect-attempts>72</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<call-failover-timeout>123</call-failover-timeout>
|
||||
<static-connectors>
|
||||
<connector-ref>connector1</connector-ref>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
<cluster-connection name="cluster-connection2">
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
<address>queues2</address>
|
||||
<connector-ref>connector2</connector-ref>
|
||||
<call-timeout>456</call-timeout>
|
||||
<retry-interval>4</retry-interval>
|
||||
<use-duplicate-detection>false</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<call-failover-timeout>456</call-failover-timeout>
|
||||
<discovery-group-ref discovery-group-name="dg1"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<security-settings>
|
||||
<security-setting match="a1">
|
||||
<permission type="createNonDurableQueue" roles="a1.1"/>
|
||||
</security-setting>
|
||||
<security-setting match="a2">
|
||||
<permission type="deleteNonDurableQueue" roles="a2.1"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<address-settings>
|
||||
<address-setting match="a1">
|
||||
<dead-letter-address>a1.1</dead-letter-address>
|
||||
<expiry-address>a1.2</expiry-address>
|
||||
<redelivery-delay>1</redelivery-delay>
|
||||
<max-size-bytes>81781728121878</max-size-bytes>
|
||||
<page-size-bytes>81738173872337</page-size-bytes>
|
||||
<page-max-cache-size>10</page-max-cache-size>
|
||||
<message-counter-history-day-limit>4</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
<expiry-address>a2.2</expiry-address>
|
||||
<redelivery-delay>5</redelivery-delay>
|
||||
<max-size-bytes>932489234928324</max-size-bytes>
|
||||
<page-size-bytes>7126716262626</page-size-bytes>
|
||||
<page-max-cache-size>20</page-max-cache-size>
|
||||
<message-counter-history-day-limit>8</message-counter-history-day-limit>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
</configuration>
|
||||
|
|
|
@ -568,7 +568,7 @@ server.
|
|||
<initial-connect-attempts>-1</initial-connect-attempts>
|
||||
<reconnect-attempts>-1</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<confirmation-window-size>32000</confirmation-window-size>
|
||||
<call-failover-timeout>30000</call-failover-timeout>
|
||||
|
@ -695,26 +695,32 @@ specified. The following shows all the available configuration options
|
|||
a bridge. For more information on duplicate detection, please see [Duplicate Detection](duplicate-detection.md).
|
||||
Default is true.
|
||||
|
||||
- `forward-when-no-consumers`. This parameter determines whether
|
||||
messages will be distributed round robin between other nodes of the
|
||||
cluster *regardless* of whether or not there are matching or indeed
|
||||
any consumers on other nodes.
|
||||
- `message-load-balancing`. This parameter determines if/how
|
||||
messages will be distributed between other nodes of the cluster.
|
||||
It can be one of three values - `OFF`, `STRICT`, or `ON_DEMAND`
|
||||
(default). This parameter replaces the deprecated
|
||||
`forward-when-no-consumers` parameter.
|
||||
|
||||
If this is set to `OFF` then messages will never be forwarded to
|
||||
another node in the cluster
|
||||
|
||||
If this is set to `true` then each incoming message will be round
|
||||
If this is set to `STRICT` then each incoming message will be round
|
||||
robin'd even though the same queues on the other nodes of the
|
||||
cluster may have no consumers at all, or they may have consumers
|
||||
that have non matching message filters (selectors). Note that
|
||||
Apache ActiveMQ Artemis will *not* forward messages to other nodes if there are no
|
||||
*queues* of the same name on the other nodes, even if this parameter
|
||||
is set to `true`.
|
||||
Apache ActiveMQ Artemis will *not* forward messages to other nodes
|
||||
if there are no *queues* of the same name on the other nodes, even
|
||||
if this parameter is set to `STRICT`. Using `STRICT` is like setting
|
||||
the legacy `foward-when-no-consumers` parameter to `true`.
|
||||
|
||||
If this is set to `false` then Apache ActiveMQ Artemis will only forward messages
|
||||
to other nodes of the cluster if the address to which they are being
|
||||
forwarded has queues which have consumers, and if those consumers
|
||||
have message filters (selectors) at least one of those selectors
|
||||
must match the message.
|
||||
If this is set to `ON_DEMAND` then Apache ActiveMQ Artemis will only
|
||||
forward messages to other nodes of the cluster if the address to which
|
||||
they are being forwarded has queues which have consumers, and if those
|
||||
consumers have message filters (selectors) at least one of those
|
||||
selectors must match the message. Using `ON_DEMAND` is like setting
|
||||
the legacy `foward-when-no-consumers` parameter to `false`.
|
||||
|
||||
Default is false.
|
||||
Default is `ON_DEMAND`.
|
||||
|
||||
- `max-hops`. When a cluster connection decides the set of nodes to
|
||||
which it might load balance a message, those nodes do not have to be
|
||||
|
@ -886,7 +892,7 @@ and is configured as follows:
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors allow-direct-connections-only="true">
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
|
@ -902,10 +908,10 @@ This means you can explicitly create any cluster topology you want.
|
|||
|
||||
Another important part of clustering is message redistribution. Earlier
|
||||
we learned how server side message load balancing round robins messages
|
||||
across the cluster. If `forward-when-no-consumers` is false, then
|
||||
messages won't be forwarded to nodes which don't have matching
|
||||
consumers, this is great and ensures that messages don't arrive on a
|
||||
queue which has no consumers to consume them, however there is a
|
||||
across the cluster. If `message-load-balancing` is `OFF` or `ON_DEMAND`
|
||||
then messages won't be forwarded to nodes which don't have matching
|
||||
consumers. This is great and ensures that messages aren't moved to a
|
||||
queue which has no consumers to consume them. However, there is a
|
||||
situation it doesn't solve: What happens if the consumers on a queue
|
||||
close after the messages have been sent to the node? If there are no
|
||||
consumers on the queue the message won't get consumed and we have a
|
||||
|
@ -914,7 +920,8 @@ consumers on the queue the message won't get consumed and we have a
|
|||
This is where message redistribution comes in. With message
|
||||
redistribution Apache ActiveMQ Artemis can be configured to automatically
|
||||
*redistribute* messages from queues which have no consumers back to
|
||||
other nodes in the cluster which do have matching consumers.
|
||||
other nodes in the cluster which do have matching consumers. To enable
|
||||
this functionality `message-load-balancing` must be `ON_DEMAND`.
|
||||
|
||||
Message redistribution can be configured to kick in immediately after
|
||||
the last consumer on a queue is closed, or to wait a configurable delay
|
||||
|
|
|
@ -163,7 +163,7 @@ Name | Description
|
|||
[max-retry-interval](clusters.md "Clusters") | Maximum value for retry-interval. Default=2000
|
||||
[reconnect-attempts](clusters.md "Clusters") | How many attempts should be made to reconnect after failure. Default=-1
|
||||
[use-duplicate-detection](clusters.md "Clusters") | should duplicate detection headers be inserted in forwarded messages?. Default=true
|
||||
[forward-when-no-consumers](clusters.md "Clusters") | should messages be load balanced if there are no matching consumers on target? Default=false
|
||||
[message-load-balancing](clusters.md "Clusters") | how should messages be load balanced? Default=OFF
|
||||
[max-hops](clusters.md "Clusters") | maximum number of hops cluster topology is propagated. Default=1
|
||||
[confirmation-window-size](client-reconnection.md "Client Reconnection and Session Reattachment")| The size (in bytes) of the window used for confirming data from the server connected to. Default 1048576
|
||||
[producer-window-size](clusters.md "Clusters") | Flow Control for the Cluster connection bridge. Default -1 (disabled)
|
||||
|
|
|
@ -33,32 +33,32 @@ under the License.
|
|||
on different nodes of the cluster, and consume from them simultaneously.
|
||||
This allows the work of processing messages from a durable subscription to be spread across the cluster in
|
||||
a similar way to how JMS Queues can be load balanced across the cluster
|
||||
</p>
|
||||
<p>In this example we first configure the two nodes to form a cluster, then we then create a durable subscriber
|
||||
</p>
|
||||
<p>In this example we first configure the two nodes to form a cluster, then we then create a durable subscriber
|
||||
with the same name and client-id on both nodes, and we create a producer on only one of the nodes.</p>
|
||||
<p>We then send some messages via the producer, and we verify that the messages are round robin'd between
|
||||
the two subscription instances. Note that each durable subscription instance with the same name and client-id
|
||||
the two subscription instances. Note that each durable subscription instance with the same name and client-id
|
||||
<b>does not</b> receive its own copy of the messages. This is because the instances on different nodes form a
|
||||
single "logical" durable subscription, in the same way multiple JMS Queue instances on different nodes
|
||||
form a single "local" JMS Queue</p>
|
||||
form a single "local" JMS Queue</p>
|
||||
<p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
|
||||
JNDI, these could be instantiated directly.
|
||||
JNDI, these could be instantiated directly.
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
|
||||
and to load balance the messages between the nodes.</p>
|
||||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
|
||||
section of the user manual.</p>
|
||||
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -96,11 +96,11 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
connection0 = cf0.createConnection();
|
||||
final String clientID = "my-client-id";
|
||||
final String clientID = "my-client-id";
|
||||
connection0.setClientID(clientID);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Connection connection1 which is a connection to server 1
|
||||
and set the same client-id.</li>
|
||||
<pre class="prettyprint">
|
||||
|
@ -116,7 +116,7 @@ under the License.
|
|||
Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Session on server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -139,7 +139,7 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
final String subscriptionName = "my-subscription";
|
||||
|
||||
|
||||
MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
|
||||
|
||||
MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
|
||||
|
@ -160,14 +160,14 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message = session0.createTextMessage("This is text message " + i);
|
||||
|
||||
|
||||
producer.send(message);
|
||||
|
||||
|
||||
System.out.println("Sent message: " + message.getText());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>
|
||||
We now consume those messages on *both* server 0 and server 1.
|
||||
Note that the messages have been load-balanced between the two nodes, with some
|
||||
|
@ -179,15 +179,15 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i += 2)
|
||||
{
|
||||
TextMessage message0 = (TextMessage)consumer0.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message0.getText() + " from node 0");
|
||||
|
||||
|
||||
TextMessage message1 = (TextMessage)consumer1.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message1.getText() + " from node 1");
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
|
@ -199,7 +199,7 @@ under the License.
|
|||
{
|
||||
connection0.close();
|
||||
}
|
||||
|
||||
|
||||
if (connection1 != null)
|
||||
{
|
||||
connection1.close();
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -39,7 +39,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
@ -61,7 +61,7 @@ under the License.
|
|||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
@ -74,9 +74,9 @@ under the License.
|
|||
</grouping-handler>
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<p>For more information on ActiveMQ Artemis clustering and grouping see the clustering and grouping
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -33,23 +33,23 @@ under the License.
|
|||
in a round-robin fashion.</p>
|
||||
<p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
|
||||
<p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
|
||||
and to load balance the messages between the nodes.</p>
|
||||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -88,7 +88,7 @@ under the License.
|
|||
connection0 = cf0.createConnection();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Connection connection1 which is a connection to server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -102,7 +102,7 @@ under the License.
|
|||
Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Session on server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -142,14 +142,14 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message = session0.createTextMessage("This is text message " + i);
|
||||
|
||||
|
||||
producer.send(message);
|
||||
|
||||
|
||||
System.out.println("Sent message: " + message.getText());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We now consume those messages on *both* server 0 and server 1.
|
||||
We note the messages have been distributed between servers in a round robin fashion.
|
||||
ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
|
||||
|
@ -162,15 +162,15 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i += 2)
|
||||
{
|
||||
TextMessage message0 = (TextMessage)consumer0.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message0.getText() + " from node 0");
|
||||
|
||||
|
||||
TextMessage message1 = (TextMessage)consumer1.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message1.getText() + " from node 1");
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
|
@ -182,7 +182,7 @@ under the License.
|
|||
{
|
||||
connection0.close();
|
||||
}
|
||||
|
||||
|
||||
if (connection1 != null)
|
||||
{
|
||||
connection1.close();
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -34,25 +34,25 @@ under the License.
|
|||
in a round-robin fashion.</p>
|
||||
<p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
|
||||
<p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
|
||||
and to load balance the messages between the nodes.</p>
|
||||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -91,7 +91,7 @@ under the License.
|
|||
connection0 = cf0.createConnection();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Connection connection1 which is a connection to server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -105,7 +105,7 @@ under the License.
|
|||
Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Session on server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -145,14 +145,14 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message = session0.createTextMessage("This is text message " + i);
|
||||
|
||||
|
||||
producer.send(message);
|
||||
|
||||
|
||||
System.out.println("Sent message: " + message.getText());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We now consume those messages on *both* server 0 and server 1.
|
||||
We note the messages have been distributed between servers in a round robin fashion.
|
||||
ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
|
||||
|
@ -165,15 +165,15 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i += 2)
|
||||
{
|
||||
TextMessage message0 = (TextMessage)consumer0.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message0.getText() + " from node 0");
|
||||
|
||||
|
||||
TextMessage message1 = (TextMessage)consumer1.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message1.getText() + " from node 1");
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
|
@ -185,7 +185,7 @@ under the License.
|
|||
{
|
||||
connection0.close();
|
||||
}
|
||||
|
||||
|
||||
if (connection1 != null)
|
||||
{
|
||||
connection1.close();
|
||||
|
|
|
@ -57,7 +57,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
|
|
|
@ -57,7 +57,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server0-connector</connector-ref>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server0-connector</connector-ref>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server0-connector</connector-ref>
|
||||
|
|
|
@ -36,7 +36,7 @@ under the License.
|
|||
in a round-robin fashion.</p>
|
||||
<p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
|
||||
<p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
JNDI, these could be instantiated directly.</p>
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a one way cluster between the three nodes
|
||||
and to load balance the messages between the nodes. Note that we have set <em>allow-direct-connections-only</em> to true,
|
||||
this means that this server will only ever connect the address's specified in the list of connectors. ALso notice
|
||||
|
@ -49,16 +49,16 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<static-connectors allow-direct-connections-only="true">
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -120,7 +120,7 @@ under the License.
|
|||
Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Session on server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -175,14 +175,14 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message = session0.createTextMessage("This is text message " + i);
|
||||
|
||||
|
||||
producer.send(message);
|
||||
|
||||
|
||||
System.out.println("Sent message: " + message.getText());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We now consume those messages on *both* server 0 and server 1.
|
||||
We note the messages have been distributed between servers in a round robin fashion.
|
||||
ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
|
||||
|
@ -195,11 +195,11 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i += 2)
|
||||
{
|
||||
TextMessage message0 = (TextMessage)consumer0.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message0.getText() + " from node 0");
|
||||
|
||||
|
||||
TextMessage message1 = (TextMessage)consumer1.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message1.getText() + " from node 1");
|
||||
|
||||
TextMessage message2 = (TextMessage)consumer2.receive(5000);
|
||||
|
@ -207,7 +207,7 @@ under the License.
|
|||
System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<static-connectors allow-direct-connections-only="true">
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
<static-connectors allow-direct-connections-only="true">
|
||||
<connector-ref>server2-connector</connector-ref>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>2</max-hops>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
|
|
|
@ -34,22 +34,22 @@ under the License.
|
|||
<p>A JMS Topic is an example of <b>publish-subscribe</b> messaging where all subscribers receive all the
|
||||
messages sent to the topic (assuming they have no message selectors).</p>
|
||||
<p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
|
||||
JNDI, these could be instantiated directly.
|
||||
JNDI, these could be instantiated directly.
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
|
||||
and to load balance the messages between the nodes.</p>
|
||||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -88,7 +88,7 @@ under the License.
|
|||
connection0 = cf0.createConnection();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Connection connection1 which is a connection to server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -102,7 +102,7 @@ under the License.
|
|||
Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create a JMS Session on server 1</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -142,14 +142,14 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message = session0.createTextMessage("This is text message " + i);
|
||||
|
||||
|
||||
producer.send(message);
|
||||
|
||||
|
||||
System.out.println("Sent message: " + message.getText());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>
|
||||
We now consume those messages on <b>both</b> server 0 and server 1.
|
||||
We note that all messages have been consumed by <b>both</b> consumers.
|
||||
|
@ -159,15 +159,15 @@ under the License.
|
|||
for (int i = 0; i < numMessages; i ++)
|
||||
{
|
||||
TextMessage message0 = (TextMessage)consumer0.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message0.getText() + " from node 0");
|
||||
|
||||
|
||||
TextMessage message1 = (TextMessage)consumer1.receive(5000);
|
||||
|
||||
|
||||
System.out.println("Got message: " + message1.getText() + " from node 1");
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
|
@ -179,7 +179,7 @@ under the License.
|
|||
{
|
||||
connection0.close();
|
||||
}
|
||||
|
||||
|
||||
if (connection1 != null)
|
||||
{
|
||||
connection1.close();
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -76,7 +76,7 @@ under the License.
|
|||
<!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -76,7 +76,7 @@ under the License.
|
|||
<!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -81,7 +81,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server1-connector</connector-ref>
|
||||
|
|
|
@ -81,7 +81,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<static-connectors>
|
||||
<connector-ref>server0-connector</connector-ref>
|
||||
|
|
|
@ -72,7 +72,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<retry-interval>500</retry-interval>
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<retry-interval>500</retry-interval>
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -46,7 +46,7 @@ under the License.
|
|||
<p>Using UDP discovery makes configuration simpler since we don't have to know what nodes are
|
||||
available at any one time.</p>
|
||||
<p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster
|
||||
with the other nodes:</p>
|
||||
with the other nodes:</p>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
<cluster-connection name="my-cluster">
|
||||
|
@ -54,19 +54,19 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>true</forward-when-no-consumers>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
</code>
|
||||
</pre>
|
||||
</pre>
|
||||
<p>In this example we create a symmetric cluster of six live nodes, and we also pair each live node
|
||||
with it's own backup node. (A backup node is not strictly necessary for a symmetric cluster).</p>
|
||||
<p>In this example will we will demonstrate this by deploying a JMS topic and Queue on all nodes of the cluster
|
||||
, sending messages to the queue and topic from different nodes, and verifying messages are received correctly
|
||||
by consumers on different nodes.</p>
|
||||
<p>For more information on configuring ActiveMQ Artemis clustering in general, please see the clustering
|
||||
section of the user manual.</p>
|
||||
section of the user manual.</p>
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
|
||||
|
||||
|
@ -77,12 +77,12 @@ under the License.
|
|||
specific server to do that, and that server might not be available at the time. By creating the
|
||||
connection factory directly we avoid having to worry about a JNDI look-up.
|
||||
In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without
|
||||
having to know about a specific one.
|
||||
having to know about a specific one.
|
||||
</li>
|
||||
|
||||
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA("231.7.7.7", 9876);
|
||||
ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA("231.7.7.7", 9876);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
@ -90,8 +90,8 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
Queue queue = new ActiveMQQueue("exampleQueue");
|
||||
|
||||
Topic topic = ActiveMQJMSClient.createActiveMQTopic("exampleTopic");
|
||||
|
||||
Topic topic = ActiveMQJMSClient.createActiveMQTopic("exampleTopic");
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
@ -165,7 +165,7 @@ under the License.
|
|||
MessageConsumer consumer0 = session0.createConsumer(queue);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<li>We create an anonymous message producer on server 2.</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
|
@ -177,15 +177,15 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
final int numMessages = 500;
|
||||
|
||||
|
||||
for (int i = 0; i < numMessages; i++)
|
||||
{
|
||||
TextMessage message1 = session2.createTextMessage("Topic message 1");
|
||||
|
||||
|
||||
producer2.send(topic, message1);
|
||||
|
||||
|
||||
TextMessage message2 = session2.createTextMessage("Queue message 1");
|
||||
|
||||
|
||||
producer2.send(queue, message2);
|
||||
}
|
||||
</code>
|
||||
|
@ -262,7 +262,7 @@ under the License.
|
|||
{
|
||||
connection1.close();
|
||||
}
|
||||
|
||||
|
||||
if (connection2 != null)
|
||||
{
|
||||
connection2.close();
|
||||
|
|
|
@ -76,7 +76,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -74,7 +74,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<forward-when-no-consumers>false</forward-when-no-consumers>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
|
|||
import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
|
||||
import org.apache.activemq.artemis.api.core.management.ManagementHelper;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.Response;
|
||||
import org.apache.activemq.artemis.core.server.management.Notification;
|
||||
|
@ -66,9 +67,9 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -141,11 +142,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -226,11 +227,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -312,13 +313,13 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(2, isFileStorage(), isNetty());
|
||||
setupServer(3, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2, 3);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2, 3);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2, 3);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1, 3);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1, 3);
|
||||
|
||||
setupClusterConnection("cluster3", "queues", false, 1, 0, 500, isNetty(), 3, 1, 2, 3);
|
||||
setupClusterConnection("cluster3", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 3, 1, 2, 3);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.activemq.artemis.core.config.ScaleDownConfiguration;
|
|||
import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
import org.jboss.byteman.contrib.bmunit.BMRule;
|
||||
import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
|
||||
|
@ -60,9 +61,9 @@ public class ScaleDownFailoverTest extends ClusterTestBase
|
|||
scaleDownConfiguration3.setGroupName("bill");
|
||||
}
|
||||
staticServers = servers;
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
scaleDownConfiguration.getConnectors().addAll(servers[0].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
scaleDownConfiguration2.getConnectors().addAll(servers[1].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
scaleDownConfiguration3.getConnectors().addAll(servers[2].getConfiguration().getClusterConfigurations().iterator().next().getStaticConnectors());
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.extras.byteman;
|
|||
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
||||
import org.apache.activemq.artemis.core.config.ScaleDownConfiguration;
|
||||
import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
import org.jboss.byteman.contrib.bmunit.BMRule;
|
||||
import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
|
||||
|
@ -44,8 +45,8 @@ public class ScaleDownFailureTest extends ClusterTestBase
|
|||
((LiveOnlyPolicyConfiguration) servers[0].getConfiguration().getHAPolicyConfiguration()).setScaleDownConfiguration(scaleDownConfiguration);
|
||||
((LiveOnlyPolicyConfiguration) servers[1].getConfiguration().getHAPolicyConfiguration()).setScaleDownConfiguration(scaleDownConfiguration);
|
||||
}
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
startServers(0, 1);
|
||||
setupSessionFactory(0, isNetty());
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
|
|||
import org.apache.activemq.artemis.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
|
||||
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.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -48,8 +49,8 @@ public class ClusterControllerTest extends ClusterTestBase
|
|||
|
||||
getServer(1).getConfiguration().setClusterPassword("something different");
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, true, 0);
|
||||
setupClusterConnection("cluster0", "queues", false, 1, true, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, true, 0);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, true, 1);
|
||||
|
||||
startServers(0);
|
||||
startServers(1);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Before;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -46,8 +47,8 @@ public class ClusterHeadersRemovedTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testHeadersRemoved() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", false, 1, isNetty(), false);
|
||||
setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty(), false);
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false);
|
||||
setupClusterConnection("clusterX", 1, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false);
|
||||
startServers(1, 0);
|
||||
|
||||
setupSessionFactory(0, isNetty());
|
||||
|
|
|
@ -57,6 +57,7 @@ import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
|
|||
import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
|
||||
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionImpl;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.cluster.qourum.SharedNothingBackupQuorum;
|
||||
import org.apache.activemq.artemis.core.server.group.GroupingHandler;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
|
||||
|
@ -1913,7 +1914,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
final int nodeFrom,
|
||||
final int nodeTo,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final boolean netty,
|
||||
final boolean allowDirectConnectionsOnly)
|
||||
|
@ -1944,7 +1945,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setAddress(address)
|
||||
.setConnectorName(name)
|
||||
.setRetryInterval(100)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setStaticConnectors(pairs)
|
||||
|
@ -1957,7 +1958,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
final int nodeFrom,
|
||||
final int nodeTo,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final int reconnectAttempts,
|
||||
final long retryInterval,
|
||||
|
@ -1991,7 +1992,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setConnectorName(name)
|
||||
.setReconnectAttempts(reconnectAttempts)
|
||||
.setRetryInterval(retryInterval)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setStaticConnectors(pairs)
|
||||
|
@ -2002,7 +2003,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
|
||||
protected void setupClusterConnection(final String name,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final boolean netty,
|
||||
final int nodeFrom,
|
||||
|
@ -2027,7 +2028,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
}
|
||||
Configuration config = serverFrom.getConfiguration();
|
||||
ClusterConnectionConfiguration clusterConf =
|
||||
createClusterConfig(name, address, forwardWhenNoConsumers,
|
||||
createClusterConfig(name, address, messageLoadBalancingType,
|
||||
maxHops,
|
||||
connectorFrom,
|
||||
pairs);
|
||||
|
@ -2037,7 +2038,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
|
||||
protected void setupClusterConnection(final String name,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final int reconnectAttempts,
|
||||
final long retryInterval,
|
||||
|
@ -2072,7 +2073,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setReconnectAttempts(reconnectAttempts)
|
||||
.setCallTimeout(100)
|
||||
.setCallFailoverTimeout(100)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setStaticConnectors(pairs);
|
||||
|
@ -2081,7 +2082,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
}
|
||||
|
||||
private ClusterConnectionConfiguration createClusterConfig(final String name, final String address,
|
||||
final boolean forwardWhenNoConsumers, final int maxHops,
|
||||
final MessageLoadBalancingType messageLoadBalancingType, final int maxHops,
|
||||
TransportConfiguration connectorFrom, List<String> pairs)
|
||||
{
|
||||
return new ClusterConnectionConfiguration()
|
||||
|
@ -2089,7 +2090,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setAddress(address)
|
||||
.setConnectorName(connectorFrom.getName())
|
||||
.setRetryInterval(250)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setStaticConnectors(pairs);
|
||||
|
@ -2097,7 +2098,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
|
||||
protected void setupClusterConnectionWithBackups(final String name,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final boolean netty,
|
||||
final int nodeFrom,
|
||||
|
@ -2127,7 +2128,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setAddress(address)
|
||||
.setConnectorName(name)
|
||||
.setRetryInterval(250)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setStaticConnectors(pairs);
|
||||
|
@ -2139,7 +2140,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
final int node,
|
||||
final String discoveryGroupName,
|
||||
final String address,
|
||||
final boolean forwardWhenNoConsumers,
|
||||
final MessageLoadBalancingType messageLoadBalancingType,
|
||||
final int maxHops,
|
||||
final boolean netty)
|
||||
{
|
||||
|
@ -2159,7 +2160,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase
|
|||
.setConnectorName(name)
|
||||
.setRetryInterval(100)
|
||||
.setDuplicateDetection(true)
|
||||
.setForwardWhenNoConsumers(forwardWhenNoConsumers)
|
||||
.setMessageLoadBalancingType(messageLoadBalancingType)
|
||||
.setMaxHops(maxHops)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setDiscoveryGroupName(discoveryGroupName);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.junit.Before;
|
||||
|
||||
|
@ -83,22 +84,22 @@ public class ClusterWithBackupTest extends ClusterTestBase
|
|||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 4, 5);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 3, 4, 5);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 3, 5);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 4, 3, 5);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 5, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 5, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 4, 5);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 4, 5);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 3, 5);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 3, 5);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 3, 4);
|
||||
}
|
||||
|
||||
protected void setupServers() throws Exception
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
||||
import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
|
||||
import org.apache.activemq.artemis.core.postoffice.impl.BindingsImpl;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.GroupingHandler;
|
||||
import org.apache.activemq.artemis.core.server.group.UnproposalListener;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.GroupBinding;
|
||||
|
@ -59,11 +60,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, 2000, 1000, 100);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1, 2000, 1000, 100);
|
||||
|
@ -168,11 +169,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, -1, 2000, 500);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -261,11 +262,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -308,11 +309,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
final int TIMEOUT_GROUPS = 5000;
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, TIMEOUT_GROUPS, -1, -1);
|
||||
|
@ -424,11 +425,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, 1000, 1000, 100);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1, 1000, 100, 100);
|
||||
|
@ -515,9 +516,9 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, 10000, 500, 750);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1, 10000, 500, 750);
|
||||
|
@ -823,11 +824,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
int TIMEOUT = 50000;
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0, TIMEOUT);
|
||||
|
@ -904,11 +905,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -983,11 +984,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1, 0);
|
||||
|
||||
|
@ -1140,11 +1141,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1187,11 +1188,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1238,11 +1239,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1285,11 +1286,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1335,11 +1336,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1381,11 +1382,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1451,11 +1452,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1514,11 +1515,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1577,11 +1578,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 0, 500, isNetty(), 2, 0, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
|
@ -1635,11 +1636,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 2);
|
||||
|
@ -1686,11 +1687,11 @@ public class ClusteredGroupingTest extends ClusterTestBase
|
|||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupServer(2, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 2);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -129,20 +130,20 @@ public class ClusteredRequestResponseTest extends ClusterTestBase
|
|||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster3", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster3", "queues", messageLoadBalancingType, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
|
||||
setupClusterConnection("cluster4", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster4", "queues", messageLoadBalancingType, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
}
|
||||
|
||||
protected void setupServers() throws Exception
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class MessageLoadBalancingTest extends ClusterTestBase
|
||||
{
|
||||
@Override
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
start();
|
||||
}
|
||||
|
||||
private void start() throws Exception
|
||||
{
|
||||
setupServers();
|
||||
|
||||
setRedistributionDelay(0);
|
||||
}
|
||||
|
||||
protected boolean isNetty()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMessageLoadBalancingOff() throws Exception
|
||||
{
|
||||
setupCluster(MessageLoadBalancingType.OFF);
|
||||
|
||||
startServers(0, 1);
|
||||
|
||||
setupSessionFactory(0, isNetty());
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
||||
createQueue(0, "queues.testaddress", "queue0", null, false);
|
||||
createQueue(1, "queues.testaddress", "queue0", null, false);
|
||||
|
||||
addConsumer(1, 1, "queue0", null);
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 1, 0, true);
|
||||
waitForBindings(1, "queues.testaddress", 1, 1, true);
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 1, 1, false);
|
||||
waitForBindings(1, "queues.testaddress", 1, 0, false);
|
||||
|
||||
addConsumer(0, 0, "queue0", null);
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 1, 1, true);
|
||||
waitForBindings(1, "queues.testaddress", 1, 1, true);
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 1, 1, false);
|
||||
waitForBindings(1, "queues.testaddress", 1, 1, false);
|
||||
|
||||
send(0, "queues.testaddress", 10, false, null);
|
||||
|
||||
ClientMessage message = getConsumer(1).receive(1000);
|
||||
Assert.assertNull(message);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
message = getConsumer(0).receive(5000);
|
||||
Assert.assertNotNull("" + i, message);
|
||||
message.acknowledge();
|
||||
}
|
||||
|
||||
ClientMessage clientMessage = getConsumer(0).receiveImmediate();
|
||||
Assert.assertNull(clientMessage);
|
||||
}
|
||||
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0);
|
||||
}
|
||||
|
||||
protected void setRedistributionDelay(final long delay)
|
||||
{
|
||||
AddressSettings as = new AddressSettings().setRedistributionDelay(delay);
|
||||
|
||||
getServer(0).getAddressSettingsRepository().addMatch("queues.*", as);
|
||||
getServer(1).getAddressSettingsRepository().addMatch("queues.*", as);
|
||||
}
|
||||
|
||||
protected void setupServers() throws Exception
|
||||
{
|
||||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
}
|
||||
|
||||
protected void stopServers() throws Exception
|
||||
{
|
||||
closeAllConsumers();
|
||||
|
||||
closeAllSessionFactories();
|
||||
|
||||
closeAllServerLocatorsFactories();
|
||||
|
||||
stopServers(0, 1);
|
||||
|
||||
clearServer(0, 1);
|
||||
}
|
||||
|
||||
}
|
|
@ -28,6 +28,7 @@ import org.apache.activemq.artemis.api.core.client.ClientConsumer;
|
|||
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
||||
import org.apache.activemq.artemis.api.core.client.ClientProducer;
|
||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.apache.activemq.artemis.core.message.impl.MessageImpl;
|
||||
import org.apache.activemq.artemis.core.server.Bindable;
|
||||
|
@ -69,7 +70,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWithMessageGroups() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
MessageRedistributionTest.log.info("Doing test");
|
||||
|
||||
|
@ -174,7 +175,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionStopsWhenConsumerAdded() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
MessageRedistributionTest.log.info("Doing test");
|
||||
|
||||
|
@ -212,7 +213,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosed() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
MessageRedistributionTest.log.info("Doing test");
|
||||
|
||||
|
@ -254,7 +255,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosedDifferentQueues() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -334,7 +335,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosedNotConsumersOnAllNodes() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -371,7 +372,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
public void testNoRedistributionWhenConsumerIsClosedForwardWhenNoConsumersTrue() throws Exception
|
||||
{
|
||||
// x
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -423,7 +424,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testNoRedistributionWhenConsumerIsClosedNoConsumersOnOtherNodes() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -473,7 +474,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributeWithScheduling() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
AddressSettings setting = new AddressSettings().setRedeliveryDelay(10000);
|
||||
servers[0].getAddressSettingsRepository().addMatch("queues.testaddress", setting);
|
||||
|
@ -583,7 +584,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosedQueuesWithFilters() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -624,7 +625,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosedConsumersWithFilters() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -665,7 +666,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenRemoteConsumerIsAdded() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -702,7 +703,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -812,7 +813,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
}
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1);
|
||||
|
||||
|
@ -877,7 +878,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionToQueuesWhereNotAllMessagesMatch() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -919,7 +920,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
final long delay = 1000;
|
||||
setRedistributionDelay(delay);
|
||||
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -959,7 +960,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
final long delay = 1000;
|
||||
setRedistributionDelay(delay);
|
||||
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -999,7 +1000,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionNumberOfMessagesGreaterThanBatchSize() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -1037,7 +1038,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWhenNewNodeIsAddedWithConsumer() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(0);
|
||||
|
||||
|
@ -1069,7 +1070,7 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRedistributionWithPagingOnTarget() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
AddressSettings as = new AddressSettings()
|
||||
.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
|
||||
|
@ -1136,13 +1137,13 @@ public class MessageRedistributionTest extends ClusterTestBase
|
|||
session1.close();
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1);
|
||||
}
|
||||
|
||||
protected void setRedistributionDelay(final long delay)
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
|
@ -53,22 +54,22 @@ public class MessageRedistributionWithDiscoveryTest extends ClusterTestBase
|
|||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
setServer(forwardWhenNoConsumers, i);
|
||||
setServer(messageLoadBalancingType, i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param forwardWhenNoConsumers
|
||||
* @param messageLoadBalancingType
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void setServer(final boolean forwardWhenNoConsumers, int server) throws Exception
|
||||
protected void setServer(final MessageLoadBalancingType messageLoadBalancingType, int server) throws Exception
|
||||
{
|
||||
setupLiveServerWithDiscovery(server,
|
||||
groupAddress,
|
||||
|
@ -83,7 +84,7 @@ public class MessageRedistributionWithDiscoveryTest extends ClusterTestBase
|
|||
|
||||
servers[server].getAddressSettingsRepository().addMatch("#", setting);
|
||||
|
||||
setupDiscoveryClusterConnection("cluster" + server, server, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster" + server, server, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -145,7 +146,7 @@ public class MessageRedistributionWithDiscoveryTest extends ClusterTestBase
|
|||
servers[0].stop();
|
||||
servers[0] = null;
|
||||
|
||||
setServer(false, 0);
|
||||
setServer(MessageLoadBalancingType.ON_DEMAND, 0);
|
||||
|
||||
startServers(1, 2);
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Before;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -52,11 +53,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testBasicRoundRobin() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -83,11 +84,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testBasicNonLoadBalanced() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -117,11 +118,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRoundRobinForwardWhenNoConsumersTrue() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", true, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", true, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", true, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", true, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -149,11 +150,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRoundRobinForwardWhenNoConsumersFalseNoLocalQueue() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -176,11 +177,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRoundRobinForwardWhenNoConsumersFalse() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -210,11 +211,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRoundRobinForwardWhenNoConsumersFalseLocalConsumer() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -244,11 +245,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testHopsTooLow() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -273,11 +274,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testStartStopMiddleOfChain() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -341,11 +342,11 @@ public class OneWayChainClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testChainClusterConnections() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
Set<ClusterConnection> connectionSet = getServer(0).getClusterManager().getClusterConnections();
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Before;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -37,12 +38,12 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
|
||||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void setupCluster(boolean forward)
|
||||
private void setupCluster(MessageLoadBalancingType messageLoadBalancingType)
|
||||
{
|
||||
for (ActiveMQServer server : servers)
|
||||
{
|
||||
|
@ -52,9 +53,9 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
}
|
||||
}
|
||||
// server #0 is connected to server #1
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", forward, 1, 0, 500, isNetty(), true);
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", messageLoadBalancingType, 1, 0, 500, isNetty(), true);
|
||||
// server #1 is connected to nobody
|
||||
setupClusterConnection("clusterX", 1, -1, "queues", forward, 1, 0, 500, isNetty(), true);
|
||||
setupClusterConnection("clusterX", 1, -1, "queues", messageLoadBalancingType, 1, 0, 500, isNetty(), true);
|
||||
}
|
||||
|
||||
protected boolean isNetty()
|
||||
|
@ -831,7 +832,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersFalseLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
startServers(1, 0);
|
||||
|
||||
setupSessionFactory(0, isNetty(), true);
|
||||
|
@ -908,7 +909,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersFalseLoadBalancedQueuesNoLocalQueue() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers(1, 0);
|
||||
|
||||
|
@ -941,7 +942,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersTrueLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
startServers(1, 0);
|
||||
|
||||
setupSessionFactory(0, isNetty(), true);
|
||||
|
@ -980,7 +981,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
{
|
||||
servers[0].getConfiguration().getClusterConfigurations().clear();
|
||||
// server #0 is connected to server #1
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 1, isNetty(), true);
|
||||
|
||||
startServers(1, 0);
|
||||
|
||||
|
@ -1020,7 +1021,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
{
|
||||
servers[0].getConfiguration().getClusterConfigurations().clear();
|
||||
// server #0 is connected to server #1
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
|
||||
setupClusterConnection("cluster1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 1, isNetty(), true);
|
||||
|
||||
startServers(1, 0);
|
||||
|
||||
|
@ -1111,7 +1112,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRoundRobinMultipleQueuesWithConsumersWithFilters() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers(1, 0);
|
||||
|
||||
|
@ -1183,8 +1184,8 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testMultipleClusterConnections() throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster2", 0, 1, "q2", false, 1, isNetty(), true);
|
||||
setupClusterConnection("cluster3", 0, 1, "q3", false, 1, isNetty(), true);
|
||||
setupClusterConnection("cluster2", 0, 1, "q2", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), true);
|
||||
setupClusterConnection("cluster3", 0, 1, "q3", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), true);
|
||||
|
||||
startServers(1, 0);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -52,17 +53,17 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupLiveServer(4, isFileStorage(), true, isNetty(), false);
|
||||
setupLiveServer(5, isFileStorage(), true, isNetty(), false);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 3, 4, 5);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 3, 4, 5);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 4, 3, 5);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 4, 3, 5);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 5, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 5, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 4, 5);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 4, 5);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 3, 5);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 3, 5);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 3, 4);
|
||||
|
||||
|
||||
startServers(0, 1, 2, 3, 4, 5);
|
||||
|
@ -96,9 +97,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupServer(1, true, isNetty());
|
||||
setupServer(2, true, isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -134,8 +135,8 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupServer(0, false, isNetty());
|
||||
setupServer(1, false, isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
||||
startServers(0, 1);
|
||||
|
||||
|
@ -182,15 +183,15 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupServer(3, true, isNetty());
|
||||
setupServer(4, true, isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster3", "queues", false, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster3", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
|
||||
setupClusterConnection("cluster4", "queues", false, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster4", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
|
||||
startServers(0, 1, 2, 3, 4);
|
||||
|
||||
|
@ -235,9 +236,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupServer(1, true, isNetty());
|
||||
setupServer(2, true, isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, 10, 100, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 10, 100, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, 10, 100, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 2, 0, 1);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -311,9 +312,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase
|
|||
setupServer(1, true, isNetty());
|
||||
setupServer(2, true, isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, -1, 1000, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, -1, 1000, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster1", "queues", false, 1, -1, 1000, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 1, 2, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 2, 0, 1);
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
import org.junit.Before;
|
||||
|
@ -1021,7 +1022,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersTrueLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1075,7 +1076,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersFalseLocalConsumerLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1130,7 +1131,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersFalseNonLoadBalancedQueues2() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1184,7 +1185,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersFalseNonLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1238,7 +1239,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testRouteWhenNoConsumersTrueNonLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1292,7 +1293,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testNoLocalQueueNonLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1331,7 +1332,7 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
@Test
|
||||
public void testNoLocalQueueLoadBalancedQueues() throws Exception
|
||||
{
|
||||
setupCluster(true);
|
||||
setupCluster(MessageLoadBalancingType.STRICT);
|
||||
|
||||
startServers();
|
||||
|
||||
|
@ -1926,32 +1927,32 @@ public class SymmetricClusterTest extends ClusterTestBase
|
|||
|
||||
protected void setupCluster(String addr1, String addr2, String addr3, String addr4, String addr5) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", addr1, true, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster0", addr1, MessageLoadBalancingType.STRICT, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster1", addr2, true, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", addr2, MessageLoadBalancingType.STRICT, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster2", addr3, true, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster2", addr3, MessageLoadBalancingType.STRICT, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster3", addr4, true, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster4", addr5, true, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster3", addr4, MessageLoadBalancingType.STRICT, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster4", addr5, MessageLoadBalancingType.STRICT, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
}
|
||||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
|
||||
setupClusterConnection("cluster3", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster3", "queues", messageLoadBalancingType, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
|
||||
setupClusterConnection("cluster4", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster4", "queues", messageLoadBalancingType, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
}
|
||||
|
||||
protected void setupServers() throws Exception
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
import org.junit.Test;
|
||||
|
@ -441,12 +442,12 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
// The lives
|
||||
setupClusterConnectionWithBackups("cluster0",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
0,
|
||||
|
@ -454,7 +455,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster1",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
1,
|
||||
|
@ -462,7 +463,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster2",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
2,
|
||||
|
@ -470,7 +471,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster3",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
3,
|
||||
|
@ -478,7 +479,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster4",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
4,
|
||||
|
@ -488,7 +489,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster0",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
5,
|
||||
|
@ -496,7 +497,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster1",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
6,
|
||||
|
@ -504,7 +505,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster2",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
7,
|
||||
|
@ -512,7 +513,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster3",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
8,
|
||||
|
@ -520,7 +521,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
|
|||
|
||||
setupClusterConnectionWithBackups("cluster4",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
9,
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
|
||||
|
@ -36,21 +37,21 @@ public class SymmetricClusterWithDiscoveryTest extends SymmetricClusterTest
|
|||
@Override
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
|
||||
setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
|
||||
setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Before;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -91,13 +92,13 @@ public class TemporaryQueueClusterTest extends ClusterTestBase
|
|||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0);
|
||||
}
|
||||
|
||||
protected void setupServers() throws Exception
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -42,8 +43,8 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase
|
|||
|
||||
protected void setupClusters()
|
||||
{
|
||||
setupClusterConnection("cluster0", 0, 1, "queues", false, 1, isNetty(), false);
|
||||
setupClusterConnection("cluster1", 1, 0, "queues", false, 1, isNetty(), false);
|
||||
setupClusterConnection("cluster0", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false);
|
||||
setupClusterConnection("cluster1", 1, 0, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false);
|
||||
}
|
||||
|
||||
protected boolean isNetty()
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
|
||||
public class TwoWayTwoNodeClusterWithDiscoveryTest extends TwoWayTwoNodeClusterTest
|
||||
{
|
||||
|
||||
|
@ -40,8 +42,8 @@ public class TwoWayTwoNodeClusterWithDiscoveryTest extends TwoWayTwoNodeClusterT
|
|||
@Override
|
||||
protected void setupClusters()
|
||||
{
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", false, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", false, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover;
|
|||
import java.util.HashSet;
|
||||
|
||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
|
@ -33,7 +34,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
|
|||
protected static final String QUEUES_TESTADDRESS = "queues.testaddress";
|
||||
private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
|
||||
|
||||
protected abstract void setupCluster(final boolean forwardWhenNoConsumers) throws Exception;
|
||||
protected abstract void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception;
|
||||
|
||||
protected abstract void setupServers() throws Exception;
|
||||
|
||||
|
@ -268,7 +269,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
|
|||
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
package org.apache.activemq.artemis.tests.integration.cluster.failover;
|
||||
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
|
||||
public class DiscoveryClusterWithBackupFailoverTest extends ClusterWithBackupFailoverTestBase
|
||||
{
|
||||
|
||||
|
@ -25,19 +27,19 @@ public class DiscoveryClusterWithBackupFailoverTest extends ClusterWithBackupFai
|
|||
protected final int groupPort = getUDPDiscoveryPort();
|
||||
|
||||
@Override
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
// The lives
|
||||
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
|
||||
// The backups
|
||||
|
||||
setupDiscoveryClusterConnection("cluster0", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 5, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster0", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 5, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|||
import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
|
||||
import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
|
@ -44,11 +45,11 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase
|
|||
|
||||
setupLiveServer(1, isFileStorage(), isSharedStore(), isNetty(), false);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 2, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
|
||||
|
@ -143,11 +144,11 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase
|
|||
|
||||
setupLiveServer(1, isFileStorage(), isSharedStore(), isNetty(), false);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 2, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 1);
|
||||
|
||||
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
|||
import org.apache.activemq.artemis.api.core.client.ClientProducer;
|
||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
||||
import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
|
@ -194,9 +195,9 @@ public class ReplicatedDistributionTest extends ClusterTestBase
|
|||
|
||||
final String address = ReplicatedDistributionTest.ADDRESS.toString();
|
||||
// notice the abuse of the method call, '3' is not a backup for '1'
|
||||
setupClusterConnectionWithBackups("test", address, false, 1, true, 1, new int[]{3});
|
||||
setupClusterConnectionWithBackups("test", address, false, 1, true, 3, new int[]{2, 1});
|
||||
setupClusterConnectionWithBackups("test", address, false, 1, true, 2, new int[]{3});
|
||||
setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 1, new int[]{3});
|
||||
setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 3, new int[]{2, 1});
|
||||
setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 2, new int[]{3});
|
||||
|
||||
AddressSettings as = new AddressSettings().setRedistributionDelay(0);
|
||||
|
||||
|
|
|
@ -16,15 +16,17 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.failover;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
|
||||
public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailoverTestBase
|
||||
{
|
||||
|
||||
@Override
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnectionWithBackups("cluster0",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
0,
|
||||
|
@ -32,7 +34,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov
|
|||
|
||||
setupClusterConnectionWithBackups("cluster1",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
1,
|
||||
|
@ -40,7 +42,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov
|
|||
|
||||
setupClusterConnectionWithBackups("cluster2",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
2,
|
||||
|
@ -48,7 +50,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov
|
|||
|
||||
setupClusterConnectionWithBackups("cluster0",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
3,
|
||||
|
@ -56,7 +58,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov
|
|||
|
||||
setupClusterConnectionWithBackups("cluster1",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
4,
|
||||
|
@ -64,7 +66,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov
|
|||
|
||||
setupClusterConnectionWithBackups("cluster2",
|
||||
"queues",
|
||||
forwardWhenNoConsumers,
|
||||
messageLoadBalancingType,
|
||||
1,
|
||||
isNetty(),
|
||||
5,
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.apache.activemq.artemis.core.config.ha.ColocatedPolicyConfiguration;
|
|||
import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -39,11 +40,11 @@ public class HAAutomaticBackupSharedStore extends ClusterTestBase
|
|||
setUpHAPolicy(1);
|
||||
setUpHAPolicy(2);
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2);
|
||||
|
||||
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1);
|
||||
setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.restart;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -35,9 +36,9 @@ public class ClusterRestartTest extends ClusterTestBase
|
|||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
||||
startServers(0, 1);
|
||||
|
||||
|
@ -100,9 +101,9 @@ public class ClusterRestartTest extends ClusterTestBase
|
|||
setupServer(0, isFileStorage(), isNetty());
|
||||
setupServer(1, isFileStorage(), isNetty());
|
||||
|
||||
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
|
||||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1);
|
||||
|
||||
setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
|
||||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0);
|
||||
|
||||
startServers(0, 1);
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.topology;
|
|||
import org.apache.activemq.artemis.api.core.TransportConfiguration;
|
||||
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
|
||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
|
||||
public class HAClientTopologyTest extends TopologyClusterTestBase
|
||||
|
@ -32,16 +33,16 @@ public class HAClientTopologyTest extends TopologyClusterTestBase
|
|||
@Override
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster3", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster4", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2, 3, 4);
|
||||
setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2, 3, 4);
|
||||
setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1, 3, 4);
|
||||
setupClusterConnection("cluster3", "queues", messageLoadBalancingType, 1, isNetty(), 3, 0, 1, 2, 4);
|
||||
setupClusterConnection("cluster4", "queues", messageLoadBalancingType, 1, isNetty(), 4, 0, 1, 2, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
|
|||
import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
|
||||
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
|
||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
|
||||
public class HAClientTopologyWithDiscoveryTest extends TopologyClusterTestBase
|
||||
{
|
||||
|
@ -36,16 +37,16 @@ public class HAClientTopologyWithDiscoveryTest extends TopologyClusterTestBase
|
|||
@Override
|
||||
protected void setupCluster() throws Exception
|
||||
{
|
||||
setupCluster(false);
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
}
|
||||
|
||||
protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception
|
||||
protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception
|
||||
{
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
|
|||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -129,6 +130,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase
|
|||
.setConnectorName("local-cc1")
|
||||
.setRetryInterval(250)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
|
||||
.setStaticConnectors(connectTo);
|
||||
|
||||
ArrayList<String> connectTo2 = new ArrayList<String>();
|
||||
|
@ -140,6 +142,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase
|
|||
.setConnectorName("local-cc2")
|
||||
.setRetryInterval(250)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
|
||||
.setStaticConnectors(connectTo2);
|
||||
|
||||
// Server1 with two acceptors, each acceptor on a different cluster connection
|
||||
|
@ -186,6 +189,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase
|
|||
.setConnectorName("local-cc1")
|
||||
.setRetryInterval(250)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
|
||||
.setStaticConnectors(connectTo);
|
||||
|
||||
List<String> connectTo2 = new ArrayList<String>();
|
||||
|
@ -197,6 +201,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase
|
|||
.setConnectorName("local-cc2")
|
||||
.setRetryInterval(250)
|
||||
.setConfirmationWindowSize(1024)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
|
||||
.setStaticConnectors(connectTo2);
|
||||
|
||||
// Server2 with two acceptors, each acceptor on a different cluster connection
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.cluster.topology;
|
||||
|
||||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -82,6 +83,7 @@ public class NonHATopologyTest extends ActiveMQTestBase
|
|||
.setConnectorName("netty")
|
||||
.setRetryInterval(1000)
|
||||
.setConfirmationWindowSize(1000)
|
||||
.setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
|
||||
.setStaticConnectors(list)
|
||||
.setAllowDirectConnectionsOnly(true));
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue