JBoss hornetq SVN: r10031 - in trunk: src/main/org/hornetq/core/server/cluster/impl and 1 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-10 09:56:36 -0500 (Fri, 10 Dec 2010)
New Revision: 10031
Modified:
trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
trunk/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java
Log:
moved creation of server locator into cluster connection
Modified: trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-12-09 22:24:10 UTC (rev 10030)
+++ trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-12-10 14:56:36 UTC (rev 10031)
@@ -139,6 +139,8 @@
private volatile boolean closed;
+ private volatile boolean closing;
+
private final List<Interceptor> interceptors = new CopyOnWriteArrayList<Interceptor>();
private static ExecutorService globalThreadPool;
@@ -408,9 +410,27 @@
}
}
- public void start() throws Exception
+ public void start(Executor executor) throws Exception
{
initialise();
+
+ executor.execute(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ connect();
+ }
+ catch (Exception e)
+ {
+ if(!closing)
+ {
+ log.warn("did not connect the cluster connection to other nodes", e);
+ }
+ }
+ }
+ });
}
public ClientSessionFactory connect() throws Exception
@@ -1000,6 +1020,8 @@
return;
}
+ closing = true;
+
if (discoveryGroup != null)
{
try
@@ -1057,6 +1079,7 @@
}
}
}
+ readOnly = false;
closed = true;
}
Modified: trunk/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-12-09 22:24:10 UTC (rev 10030)
+++ trunk/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-12-10 14:56:36 UTC (rev 10031)
@@ -19,6 +19,8 @@
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
+import java.util.concurrent.Executor;
+
/**
* A ServerLocatorInternal
*
@@ -28,7 +30,7 @@
*/
public interface ServerLocatorInternal extends ServerLocator
{
- void start() throws Exception;
+ void start(Executor executor) throws Exception;
void factoryClosed(final ClientSessionFactory factory);
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-12-09 22:24:10 UTC (rev 10030)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-12-10 14:56:36 UTC (rev 10031)
@@ -16,17 +16,16 @@
import static org.hornetq.api.core.management.NotificationType.CONSUMER_CLOSED;
import static org.hornetq.api.core.management.NotificationType.CONSUMER_CREATED;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
+import java.util.*;
import java.util.Map.Entry;
-import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
+import org.hornetq.api.core.DiscoveryGroupConfiguration;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.management.ManagementHelper;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.client.impl.ServerLocatorInternal;
@@ -35,6 +34,7 @@
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.postoffice.PostOffice;
import org.hornetq.core.postoffice.impl.PostOfficeImpl;
+import org.hornetq.core.server.HornetQComponent;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.cluster.Bridge;
@@ -75,6 +75,8 @@
private final SimpleString address;
+ private final long retryInterval;
+
private final boolean useDuplicateDetection;
private final boolean routeWhenNoConsumers;
@@ -95,7 +97,9 @@
private final String clusterPassword;
- private final ServerLocatorInternal serverLocator;
+ private final ClusterConnector clusterConnector;
+
+ private ServerLocatorInternal serverLocator;
private final TransportConfiguration connector;
@@ -103,7 +107,7 @@
private final Set<TransportConfiguration> allowableConnections = new HashSet<TransportConfiguration>();
- public ClusterConnectionImpl(final ServerLocatorInternal serverLocator,
+ public ClusterConnectionImpl(final TransportConfiguration[] tcConfigs,
final TransportConfiguration connector,
final SimpleString name,
final SimpleString address,
@@ -130,39 +134,89 @@
}
this.nodeUUID = nodeUUID;
-
- this.serverLocator = serverLocator;
+ this.connector = connector;
+
+ this.name = name;
+
+ this.address = address;
+
+ this.retryInterval = retryInterval;
+
+ this.useDuplicateDetection = useDuplicateDetection;
+
+ this.routeWhenNoConsumers = routeWhenNoConsumers;
+
+ this.executorFactory = executorFactory;
+
+ this.server = server;
+
+ this.postOffice = postOffice;
+
+ this.managementService = managementService;
+
+ this.scheduledExecutor = scheduledExecutor;
+
+ this.maxHops = maxHops;
+
+ this.backup = backup;
+
+ this.clusterUser = clusterUser;
+
+ this.clusterPassword = clusterPassword;
+
this.allowDirectConnectionsOnly = allowDirectConnectionsOnly;
- if (this.serverLocator != null)
+
+ clusterConnector = new StaticClusterConnector(tcConfigs);
+
+ if (tcConfigs != null && tcConfigs.length > 0)
{
- this.serverLocator.setClusterConnection(true);
- this.serverLocator.setClusterTransportConfiguration(connector);
- this.serverLocator.setBackup(server.getConfiguration().isBackup());
- this.serverLocator.setInitialConnectAttempts(-1);
- if(retryInterval > 0)
- {
- this.serverLocator.setRetryInterval(retryInterval);
- }
-
// a cluster connection will connect to other nodes only if they are directly connected
// through a static list of connectors or broadcasting using UDP.
- TransportConfiguration[] transportConfigurations = serverLocator.getStaticTransportConfigurations();
- if(this.allowDirectConnectionsOnly)
+ if(allowDirectConnectionsOnly)
{
- for (TransportConfiguration transportConfiguration : transportConfigurations)
- {
- allowableConnections.add(transportConfiguration);
- }
+ allowableConnections.addAll(Arrays.asList(tcConfigs));
}
}
+ }
+
+ public ClusterConnectionImpl(DiscoveryGroupConfiguration dg,
+ final TransportConfiguration connector,
+ final SimpleString name,
+ final SimpleString address,
+ final long retryInterval,
+ final boolean useDuplicateDetection,
+ final boolean routeWhenNoConsumers,
+ final int confirmationWindowSize,
+ final ExecutorFactory executorFactory,
+ final HornetQServer server,
+ final PostOffice postOffice,
+ final ManagementService managementService,
+ final ScheduledExecutorService scheduledExecutor,
+ final int maxHops,
+ final UUID nodeUUID,
+ final boolean backup,
+ final String clusterUser,
+ final String clusterPassword,
+ final boolean allowDirectConnectionsOnly) throws Exception
+ {
+
+ if (nodeUUID == null)
+ {
+ throw new IllegalArgumentException("node id is null");
+ }
+
+ this.nodeUUID = nodeUUID;
+
this.connector = connector;
this.name = name;
this.address = address;
+ this.retryInterval = retryInterval;
+
this.useDuplicateDetection = useDuplicateDetection;
this.routeWhenNoConsumers = routeWhenNoConsumers;
@@ -184,6 +238,10 @@
this.clusterUser = clusterUser;
this.clusterPassword = clusterPassword;
+
+ this.allowDirectConnectionsOnly = allowDirectConnectionsOnly;
+
+ clusterConnector = new DiscoveryClusterConnector(dg);
}
public synchronized void start() throws Exception
@@ -238,6 +296,12 @@
managementService.sendNotification(notification);
}
+ if(serverLocator != null)
+ {
+ serverLocator.close();
+ serverLocator = null;
+ }
+
started = false;
}
}
@@ -279,29 +343,28 @@
backup = false;
+ serverLocator = clusterConnector.createServerLocator();
+
if (serverLocator != null)
{
+ serverLocator.setNodeID(nodeUUID.toString());
+
+ serverLocator.setReconnectAttempts(-1);
+
+ serverLocator.setClusterConnection(true);
+ serverLocator.setClusterTransportConfiguration(connector);
+ serverLocator.setBackup(server.getConfiguration().isBackup());
+ serverLocator.setInitialConnectAttempts(-1);
+
+ if(retryInterval > 0)
+ {
+ this.serverLocator.setRetryInterval(retryInterval);
+ }
+
serverLocator.addClusterTopologyListener(this);
- serverLocator.start();
- // FIXME Ugly ugly code to connect to other nodes and form the cluster... :(
- server.getExecutorFactory().getExecutor().execute(new Runnable()
- {
- public void run()
- {
- try
- {
- serverLocator.connect();
- }
- catch (Exception e)
- {
- if(started)
- {
- log.warn("did not connect the cluster connection to other nodes", e);
- }
- }
- }
- });
+
+ serverLocator.start(server.getExecutorFactory().getExecutor());
}
if (managementService != null)
@@ -909,4 +972,46 @@
return out;
}
+
+ interface ClusterConnector
+ {
+ ServerLocatorInternal createServerLocator();
+ }
+
+ private class StaticClusterConnector implements ClusterConnector
+ {
+ private final TransportConfiguration[] tcConfigs;
+
+ public StaticClusterConnector(TransportConfiguration[] tcConfigs)
+ {
+ this.tcConfigs = tcConfigs;
+ }
+
+ public ServerLocatorInternal createServerLocator()
+ {
+ if(tcConfigs != null && tcConfigs.length > 0)
+ {
+ return (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(tcConfigs);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+
+ private class DiscoveryClusterConnector implements ClusterConnector
+ {
+ private final DiscoveryGroupConfiguration dg;
+
+ public DiscoveryClusterConnector(DiscoveryGroupConfiguration dg)
+ {
+ this.dg = dg;
+ }
+
+ public ServerLocatorInternal createServerLocator()
+ {
+ return (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(dg);
+ }
+ }
}
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-09 22:24:10 UTC (rev 10030)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-10 14:56:36 UTC (rev 10031)
@@ -732,18 +732,16 @@
return;
}
- ServerLocatorInternal serverLocator;
- if (config.getStaticConnectors() != null && config.getStaticConnectors().size() > 0)
+ if(clusterConnections.containsKey(config.getName()))
{
- TransportConfiguration[] tcConfigs = connectorNameListToArray(config.getStaticConnectors());
+ log.warn("Clustwer Configuration '" + config.getConnectorName() + "' already exists. The cluster connection will not be deployed.");
+ return;
+ }
- serverLocator = (ServerLocatorInternal)HornetQClient.createServerLocatorWithHA(tcConfigs);
- serverLocator.setNodeID(nodeUUID.toString());
- serverLocator.setReconnectAttempts(-1);
- clusterLocators.add(serverLocator);
- }
- else if (config.getDiscoveryGroupName() != null)
+ ClusterConnectionImpl clusterConnection;
+
+ if (config.getDiscoveryGroupName() != null)
{
DiscoveryGroupConfiguration dg = configuration.getDiscoveryGroupConfigurations()
.get(config.getDiscoveryGroupName());
@@ -754,38 +752,51 @@
"'. The cluster connection will not be deployed.");
}
- serverLocator = (ServerLocatorInternal)HornetQClient.createServerLocatorWithHA(dg);
- serverLocator.setNodeID(nodeUUID.toString());
- serverLocator.setReconnectAttempts(-1);
- clusterLocators.add(serverLocator);
+ clusterConnection = new ClusterConnectionImpl(dg,
+ connector,
+ new SimpleString(config.getName()),
+ new SimpleString(config.getAddress()),
+ config.getRetryInterval(),
+ config.isDuplicateDetection(),
+ config.isForwardWhenNoConsumers(),
+ config.getConfirmationWindowSize(),
+ executorFactory,
+ server,
+ postOffice,
+ managementService,
+ scheduledExecutor,
+ config.getMaxHops(),
+ nodeUUID,
+ backup,
+ server.getConfiguration().getClusterUser(),
+ server.getConfiguration().getClusterPassword(),
+ config.isAllowDirectConnectionsOnly());
}
else
{
- // no connector or discovery group are defined. The cluster connection will only be a target and will
- // no connect to other nodes in the cluster
- serverLocator = null;
+ TransportConfiguration[] tcConfigs = config.getStaticConnectors() != null? connectorNameListToArray(config.getStaticConnectors()):null;
+
+ clusterConnection = new ClusterConnectionImpl(tcConfigs,
+ connector,
+ new SimpleString(config.getName()),
+ new SimpleString(config.getAddress()),
+ config.getRetryInterval(),
+ config.isDuplicateDetection(),
+ config.isForwardWhenNoConsumers(),
+ config.getConfirmationWindowSize(),
+ executorFactory,
+ server,
+ postOffice,
+ managementService,
+ scheduledExecutor,
+ config.getMaxHops(),
+ nodeUUID,
+ backup,
+ server.getConfiguration().getClusterUser(),
+ server.getConfiguration().getClusterPassword(),
+ config.isAllowDirectConnectionsOnly());
}
- ClusterConnectionImpl clusterConnection = new ClusterConnectionImpl(serverLocator,
- connector,
- new SimpleString(config.getName()),
- new SimpleString(config.getAddress()),
- config.getRetryInterval(),
- config.isDuplicateDetection(),
- config.isForwardWhenNoConsumers(),
- config.getConfirmationWindowSize(),
- executorFactory,
- server,
- postOffice,
- managementService,
- scheduledExecutor,
- config.getMaxHops(),
- nodeUUID,
- backup,
- server.getConfiguration().getClusterUser(),
- server.getConfiguration().getClusterPassword(),
- config.isAllowDirectConnectionsOnly());
-
managementService.registerCluster(clusterConnection, config);
clusterConnections.put(config.getName(), clusterConnection);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2010-12-09 22:24:10 UTC (rev 10030)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2010-12-10 14:56:36 UTC (rev 10031)
@@ -774,11 +774,6 @@
public void testRouteWhenNoConsumersTrueNonBalancedQueues() throws Exception
{
- // server #0 is connected to server #1
- setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
- // server #1 is connected to nobody
- setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty(), true);
-
startServers(1, 0);
setupSessionFactory(0, isNetty(), true);
14 years, 1 month
JBoss hornetq SVN: r10030 - tags.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-09 17:24:10 -0500 (Thu, 09 Dec 2010)
New Revision: 10030
Added:
tags/HornetQ_2_2_0_QA4/
Log:
Tagging a new release with LMC
Copied: tags/HornetQ_2_2_0_QA4 (from rev 10029, trunk)
14 years, 1 month
JBoss hornetq SVN: r10029 - trunk.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-09 17:10:34 -0500 (Thu, 09 Dec 2010)
New Revision: 10029
Modified:
trunk/build-maven.xml
Log:
QA4
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-12-09 18:29:12 UTC (rev 10028)
+++ trunk/build-maven.xml 2010-12-09 22:10:34 UTC (rev 10029)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.0.QA3"/>
+ <property name="hornetq.version" value="2.2.0.QA4"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
14 years, 1 month
JBoss hornetq SVN: r10028 - in trunk/examples/jms: clustered-static-oneway and 8 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 13:29:12 -0500 (Thu, 09 Dec 2010)
New Revision: 10028
Added:
trunk/examples/jms/clustered-static-oneway/
trunk/examples/jms/clustered-static-oneway/build.bat
trunk/examples/jms/clustered-static-oneway/build.sh
trunk/examples/jms/clustered-static-oneway/build.xml
trunk/examples/jms/clustered-static-oneway/readme.html
trunk/examples/jms/clustered-static-oneway/server0/
trunk/examples/jms/clustered-static-oneway/server0/client-jndi.properties
trunk/examples/jms/clustered-static-oneway/server0/hornetq-beans.xml
trunk/examples/jms/clustered-static-oneway/server0/hornetq-configuration.xml
trunk/examples/jms/clustered-static-oneway/server0/hornetq-jms.xml
trunk/examples/jms/clustered-static-oneway/server0/hornetq-users.xml
trunk/examples/jms/clustered-static-oneway/server0/jndi.properties
trunk/examples/jms/clustered-static-oneway/server1/
trunk/examples/jms/clustered-static-oneway/server1/client-jndi.properties
trunk/examples/jms/clustered-static-oneway/server1/hornetq-beans.xml
trunk/examples/jms/clustered-static-oneway/server1/hornetq-configuration.xml
trunk/examples/jms/clustered-static-oneway/server1/hornetq-jms.xml
trunk/examples/jms/clustered-static-oneway/server1/hornetq-users.xml
trunk/examples/jms/clustered-static-oneway/server1/jndi.properties
trunk/examples/jms/clustered-static-oneway/server2/
trunk/examples/jms/clustered-static-oneway/server2/client-jndi.properties
trunk/examples/jms/clustered-static-oneway/server2/hornetq-beans.xml
trunk/examples/jms/clustered-static-oneway/server2/hornetq-configuration.xml
trunk/examples/jms/clustered-static-oneway/server2/hornetq-jms.xml
trunk/examples/jms/clustered-static-oneway/server2/hornetq-users.xml
trunk/examples/jms/clustered-static-oneway/server2/jndi.properties
trunk/examples/jms/clustered-static-oneway/src/
trunk/examples/jms/clustered-static-oneway/src/org/
trunk/examples/jms/clustered-static-oneway/src/org/hornetq/
trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/
trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/example/
trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/example/ClusterStaticOnewayExample.java
Log:
added static one way cluster example
Added: trunk/examples/jms/clustered-static-oneway/build.bat
===================================================================
--- trunk/examples/jms/clustered-static-oneway/build.bat (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/build.bat 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,13 @@
+@echo off
+
+set "OVERRIDE_ANT_HOME=..\..\..\tools\ant"
+
+if exist "..\..\..\src\bin\build.bat" (
+ rem running from TRUNK
+ call ..\..\..\src\bin\build.bat %*
+) else (
+ rem running from the distro
+ call ..\..\..\bin\build.bat %*
+)
+
+set "OVERRIDE_ANT_HOME="
Added: trunk/examples/jms/clustered-static-oneway/build.sh
===================================================================
--- trunk/examples/jms/clustered-static-oneway/build.sh (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/build.sh 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+OVERRIDE_ANT_HOME=../../../tools/ant
+export OVERRIDE_ANT_HOME
+
+if [ -f "../../../src/bin/build.sh" ]; then
+ # running from TRUNK
+ ../../../src/bin/build.sh "$@"
+else
+ # running from the distro
+ ../../../bin/build.sh "$@"
+fi
+
+
+
Property changes on: trunk/examples/jms/clustered-static-oneway/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/examples/jms/clustered-static-oneway/build.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/build.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/build.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../../../thirdparty/libraries.ent">
+ ]>
+<project default="run" name="HornetQ JMS Static Clustered Queue Example">
+
+ <import file="../../common/build.xml"/>
+
+ <target name="run">
+ <antcall target="runExample">
+ <param name="example.classname" value="org.hornetq.jms.example.ClusterStaticOnewayExample"/>
+ <param name="hornetq.example.beans.file" value="server0 server1 server2"/>
+ </antcall>
+ </target>
+
+ <target name="runRemote">
+ <antcall target="runExample">
+ <param name="example.classname" value="org.hornetq.jms.example.ClusterStaticOnewayExample"/>
+ <param name="hornetq.example.runServer" value="false"/>
+ </antcall>
+ </target>
+
+</project>
Added: trunk/examples/jms/clustered-static-oneway/readme.html
===================================================================
--- trunk/examples/jms/clustered-static-oneway/readme.html (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/readme.html 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,180 @@
+<html>
+ <head>
+ <title>HornetQ JMS Load Balanced Static Clustered Queue Example</title>
+ <link rel="stylesheet" type="text/css" href="../../common/common.css" />
+ <link rel="stylesheet" type="text/css" href="../../common/prettify.css" />
+ <script type="text/javascript" src="../../common/prettify.js"></script>
+ </head>
+ <body onload="prettyPrint()">
+ <h1>JMS Load Balanced Static Clustered Queue Example</h1>
+
+ <p>This example demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster
+ from a <em>static</em> list of nodes.</p>
+ <p>We then create a consumer on the queue on each node, 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 <b>both</b> consumers receive the sent messages
+ in a round-robin fashion.</p>
+ <p>In other words, HornetQ <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>
+ <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>
+ <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>
+ <max-hops>1</max-hops>
+ <static-connectors>
+ <connector-ref>server1-connector</connector-ref>
+ </static-connectors>
+ </cluster-connection>
+ </code>
+ </pre>
+ <p>For more information on HornetQ load balancing, and clustering in general, please see the clustering
+ section of the user manual.</p>
+ <h2>Example step-by-step</h2>
+ <p><i>To run the example, simply type <code>./build.sh</code> (or <code>build.bat</code> on windows) from this directory</i></p>
+
+ <ol>
+ <li> Get an initial context for looking up JNDI from server 0.</li>
+ <pre class="prettyprint">
+ <code>
+ ic0 = getContext(0);
+ </code>
+ </pre>
+
+ <li>Look-up the JMS Queue object from JNDI</li>
+ <pre class="prettyprint">
+ <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
+ </pre>
+
+ <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
+ <pre class="prettyprint">
+ <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
+ </pre>
+
+ <li>Get an initial context for looking up JNDI from server 1.</li>
+ <pre class="prettyprint">
+ <code>ic1 = getContext(1);</code>
+ </pre>
+
+ <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
+ <pre class="prettyprint">
+ <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
+ </code>
+ </pre>
+
+ <li>We create a JMS Connection connection0 which is a connection to server 0</li>
+ <pre class="prettyprint">
+ <code>
+ connection0 = cf0.createConnection();
+ </code>
+ </pre>
+
+ <li>We create a JMS Connection connection1 which is a connection to server 1</li>
+ <pre class="prettyprint">
+ <code>
+ connection1 = cf1.createConnection();
+ </code>
+ </pre>
+
+ <li>We create a JMS Session on server 0</li>
+ <pre class="prettyprint">
+ <code>
+ Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ </code>
+ </pre>
+
+ <li>We create a JMS Session on server 1</li>
+ <pre class="prettyprint">
+ <code>
+ Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ </code>
+ </pre>
+
+ <li>We start the connections to ensure delivery occurs on them</li>
+ <pre class="prettyprint">
+ <code>
+ connection0.start();
+
+ connection1.start();
+ </code>
+ </pre>
+
+ <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
+ <pre class="prettyprint">
+ <code>
+ MessageConsumer consumer0 = session0.createConsumer(queue);
+
+ MessageConsumer consumer1 = session1.createConsumer(queue);
+ </code>
+ </pre>
+
+ <li>We create a JMS MessageProducer object on server 0.</li>
+ <pre class="prettyprint">
+ <code>
+ MessageProducer producer = session0.createProducer(queue);</code>
+ </pre>
+
+ <li>We send some messages to server 0.</li>
+ <pre class="prettyprint">
+ <code>
+ final int numMessages = 10;
+
+ 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.
+ HornetQ has <b>load balanced</b> the messages between the available consumers on the different nodes.
+ HornetQ can be configured to always load balance messages to all nodes, or to only balance messages
+ to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
+ JMS Queues implement point-to-point message where each message is only ever consumed by a
+ maximum of one consumer.
+ <pre class="prettyprint">
+ <code>
+ 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>
+
+ <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>
+
+ <pre class="prettyprint">
+ <code>
+ finally
+ {
+ if (connection0 != null)
+ {
+ connection0.close();
+ }
+
+ if (connection1 != null)
+ {
+ connection1.close();
+ }
+ }
+ </code>
+ </pre>
+
+ </ol>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server0/client-jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/client-jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/client-jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: trunk/examples/jms/clustered-static-oneway/server0/hornetq-beans.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/hornetq-beans.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/hornetq-beans.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Naming" class="org.jnp.server.NamingBeanImpl"/>
+
+ <!-- JNDI server. Disable this if you don't want JNDI -->
+ <bean name="JNDIServer" class="org.jnp.server.Main">
+ <property name="namingInfo">
+ <inject bean="Naming"/>
+ </property>
+ <property name="port">1099</property>
+ <property name="bindAddress">localhost</property>
+ <property name="rmiPort">1098</property>
+ <property name="rmiBindAddress">localhost</property>
+ </bean>
+
+ <!-- MBean server -->
+ <bean name="MBeanServer" class="javax.management.MBeanServer">
+ <constructor factoryClass="java.lang.management.ManagementFactory"
+ factoryMethod="getPlatformMBeanServer"/>
+ </bean>
+
+ <!-- The core configuration -->
+ <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration"/>
+
+ <!-- The security manager -->
+ <bean name="HornetQSecurityManager" class="org.hornetq.spi.core.security.HornetQSecurityManagerImpl">
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The core server -->
+ <bean name="HornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="Configuration"/>
+ </parameter>
+ <parameter>
+ <inject bean="MBeanServer"/>
+ </parameter>
+ <parameter>
+ <inject bean="HornetQSecurityManager"/>
+ </parameter>
+ </constructor>
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The JMS server -->
+ <bean name="JMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="HornetQServer"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+
+</deployment>
Added: trunk/examples/jms/clustered-static-oneway/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/hornetq-configuration.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/hornetq-configuration.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,69 @@
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <clustered>true</clustered>
+
+ <!-- Connectors -->
+
+ <connectors>
+ <connector name="netty-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="port" value="5445"/>
+ </connector>
+ <!-- connector to the server1 -->
+ <connector name="server1-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="port" value="5446"/>
+ </connector>
+ </connectors>
+
+ <!-- Acceptors -->
+ <acceptors>
+ <acceptor name="netty-acceptor">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+ <param key="port" value="5445"/>
+ </acceptor>
+ </acceptors>
+
+ <cluster-connections>
+ <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>
+ <max-hops>1</max-hops>
+ <static-connectors allow-direct-connections-only="true">
+ <connector-ref>server1-connector</connector-ref>
+ </static-connectors>
+ </cluster-connection>
+ </cluster-connections>
+
+ <!-- Other config -->
+
+ <security-settings>
+ <!--security for example queue-->
+ <security-setting match="jms.queue.exampleQueue">
+ <permission type="createDurableQueue" roles="guest"/>
+ <permission type="deleteDurableQueue" roles="guest"/>
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
+
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server0/hornetq-jms.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/hornetq-jms.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/hornetq-jms.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,31 @@
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+ <!--the connection factory used by the example-->
+ <connection-factory name="ConnectionFactory">
+ <connectors>
+ <connector-ref connector-name="netty-connector"/>
+ </connectors>
+ <entries>
+ <entry name="ConnectionFactory"/>
+ </entries>
+
+ <ha>true</ha>
+ <!-- Pause 1 second between connect attempts -->
+ <retry-interval>1000</retry-interval>
+
+ <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
+ implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
+ pause is the same length -->
+ <retry-interval-multiplier>1.0</retry-interval-multiplier>
+
+ <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
+ <reconnect-attempts>-1</reconnect-attempts>
+ </connection-factory>
+
+ <!--the queue used by the example-->
+ <queue name="exampleQueue">
+ <entry name="/queue/exampleQueue"/>
+ </queue>
+
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server0/hornetq-users.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/hornetq-users.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/hornetq-users.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-users.xsd">
+ <!-- the default user. this is used where username is null-->
+ <defaultuser name="guest" password="guest">
+ <role name="guest"/>
+ </defaultuser>
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server0/jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server0/jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server0/jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server1/client-jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/client-jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/client-jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:2099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: trunk/examples/jms/clustered-static-oneway/server1/hornetq-beans.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/hornetq-beans.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/hornetq-beans.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Naming" class="org.jnp.server.NamingBeanImpl"/>
+
+ <!-- JNDI server. Disable this if you don't want JNDI -->
+ <bean name="JNDIServer" class="org.jnp.server.Main">
+ <property name="namingInfo">
+ <inject bean="Naming"/>
+ </property>
+ <property name="port">2099</property>
+ <property name="bindAddress">localhost</property>
+ <property name="rmiPort">2098</property>
+ <property name="rmiBindAddress">localhost</property>
+ </bean>
+
+ <!-- MBean server -->
+ <bean name="MBeanServer" class="javax.management.MBeanServer">
+ <constructor factoryClass="java.lang.management.ManagementFactory"
+ factoryMethod="getPlatformMBeanServer"/>
+ </bean>
+
+ <!-- The core configuration -->
+ <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration"/>
+
+ <!-- The security manager -->
+ <bean name="HornetQSecurityManager" class="org.hornetq.spi.core.security.HornetQSecurityManagerImpl">
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The core server -->
+ <bean name="HornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="Configuration"/>
+ </parameter>
+ <parameter>
+ <inject bean="MBeanServer"/>
+ </parameter>
+ <parameter>
+ <inject bean="HornetQSecurityManager"/>
+ </parameter>
+ </constructor>
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The JMS server -->
+ <bean name="JMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="HornetQServer"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+</deployment>
Added: trunk/examples/jms/clustered-static-oneway/server1/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/hornetq-configuration.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/hornetq-configuration.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,69 @@
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <clustered>true</clustered>
+
+ <!-- Connectors -->
+ <connectors>
+ <connector name="netty-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="port" value="5446"/>
+ </connector>
+ <!-- connector to the server0 -->
+ <connector name="server2-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="port" value="5447"/>
+ </connector>
+ </connectors>
+
+ <!-- Acceptors -->
+ <acceptors>
+ <acceptor name="netty-acceptor">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+ <param key="port" value="5446"/>
+ </acceptor>
+ </acceptors>
+
+ <!-- Clustering configuration -->
+ <cluster-connections>
+ <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>
+ <max-hops>1</max-hops>
+ <static-connectors allow-direct-connections-only="true">
+ <connector-ref>server2-connector</connector-ref>
+ </static-connectors>
+ </cluster-connection>
+ </cluster-connections>
+
+ <!-- Other config -->
+
+ <security-settings>
+ <!--security for example queue-->
+ <security-setting match="jms.queue.exampleQueue">
+ <permission type="createDurableQueue" roles="guest"/>
+ <permission type="deleteDurableQueue" roles="guest"/>
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
+
+</configuration>
Added: trunk/examples/jms/clustered-static-oneway/server1/hornetq-jms.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/hornetq-jms.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/hornetq-jms.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,31 @@
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+ <!--the connection factory used by the example-->
+ <connection-factory name="ConnectionFactory">
+ <connectors>
+ <connector-ref connector-name="netty-connector"/>
+ </connectors>
+ <entries>
+ <entry name="ConnectionFactory"/>
+ </entries>
+
+ <ha>true</ha>
+ <!-- Pause 1 second between connect attempts -->
+ <retry-interval>1000</retry-interval>
+
+ <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
+ implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
+ pause is the same length -->
+ <retry-interval-multiplier>1.0</retry-interval-multiplier>
+
+ <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
+ <reconnect-attempts>-1</reconnect-attempts>
+ </connection-factory>
+
+ <!--the queue used by the example-->
+ <queue name="exampleQueue">
+ <entry name="/queue/exampleQueue"/>
+ </queue>
+
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server1/hornetq-users.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/hornetq-users.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/hornetq-users.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-users.xsd">
+ <!-- the default user. this is used where username is null-->
+ <defaultuser name="guest" password="guest">
+ <role name="guest"/>
+ </defaultuser>
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server1/jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server1/jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server1/jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server2/client-jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/client-jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/client-jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,16 @@
+#
+# Copyright 2009 Red Hat, Inc.
+# Red Hat 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.
+#
+
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:3099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: trunk/examples/jms/clustered-static-oneway/server2/hornetq-beans.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/hornetq-beans.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/hornetq-beans.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Naming" class="org.jnp.server.NamingBeanImpl"/>
+
+ <!-- JNDI server. Disable this if you don't want JNDI -->
+ <bean name="JNDIServer" class="org.jnp.server.Main">
+ <property name="namingInfo">
+ <inject bean="Naming"/>
+ </property>
+ <property name="port">3099</property>
+ <property name="bindAddress">localhost</property>
+ <property name="rmiPort">3098</property>
+ <property name="rmiBindAddress">localhost</property>
+ </bean>
+
+ <!-- MBean server -->
+ <bean name="MBeanServer" class="javax.management.MBeanServer">
+ <constructor factoryClass="java.lang.management.ManagementFactory"
+ factoryMethod="getPlatformMBeanServer"/>
+ </bean>
+
+ <!-- The core configuration -->
+ <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration"/>
+
+ <!-- The security manager -->
+ <bean name="HornetQSecurityManager" class="org.hornetq.spi.core.security.HornetQSecurityManagerImpl">
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The core server -->
+ <bean name="HornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="Configuration"/>
+ </parameter>
+ <parameter>
+ <inject bean="MBeanServer"/>
+ </parameter>
+ <parameter>
+ <inject bean="HornetQSecurityManager"/>
+ </parameter>
+ </constructor>
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
+
+ <!-- The JMS server -->
+ <bean name="JMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="HornetQServer"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+</deployment>
Added: trunk/examples/jms/clustered-static-oneway/server2/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/hornetq-configuration.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/hornetq-configuration.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,61 @@
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <clustered>true</clustered>
+
+ <!-- Connectors -->
+ <connectors>
+ <connector name="netty-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="port" value="5447"/>
+ </connector>
+ </connectors>
+
+ <!-- Acceptors -->
+ <acceptors>
+ <acceptor name="netty-acceptor">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+ <param key="port" value="5447"/>
+ </acceptor>
+ </acceptors>
+
+ <!-- Clustering configuration -->
+ <cluster-connections>
+ <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>
+ <max-hops>2</max-hops>
+ </cluster-connection>
+ </cluster-connections>
+
+ <!-- Other config -->
+
+ <security-settings>
+ <!--security for example queue-->
+ <security-setting match="jms.queue.exampleQueue">
+ <permission type="createDurableQueue" roles="guest"/>
+ <permission type="deleteDurableQueue" roles="guest"/>
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
+
+</configuration>
Added: trunk/examples/jms/clustered-static-oneway/server2/hornetq-jms.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/hornetq-jms.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/hornetq-jms.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,45 @@
+<!--
+ ~ Copyright 2009 Red Hat, Inc.
+ ~ Red Hat 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.
+ -->
+
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+ <!--the connection factory used by the example-->
+ <connection-factory name="ConnectionFactory">
+ <connectors>
+ <connector-ref connector-name="netty-connector"/>
+ </connectors>
+ <entries>
+ <entry name="ConnectionFactory"/>
+ </entries>
+
+ <ha>true</ha>
+ <!-- Pause 1 second between connect attempts -->
+ <retry-interval>1000</retry-interval>
+
+ <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
+ implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
+ pause is the same length -->
+ <retry-interval-multiplier>1.0</retry-interval-multiplier>
+
+ <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
+ <reconnect-attempts>-1</reconnect-attempts>
+
+ </connection-factory>
+
+ <!--the queue used by the example-->
+ <queue name="exampleQueue">
+ <entry name="/queue/exampleQueue"/>
+ </queue>
+
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server2/hornetq-users.xml
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/hornetq-users.xml (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/hornetq-users.xml 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-users.xsd">
+ <!-- the default user. this is used where username is null-->
+ <defaultuser name="guest" password="guest">
+ <role name="guest"/>
+ </defaultuser>
+</configuration>
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/server2/jndi.properties
===================================================================
--- trunk/examples/jms/clustered-static-oneway/server2/jndi.properties (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/server2/jndi.properties 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,15 @@
+#
+# Copyright 2009 Red Hat, Inc.
+# Red Hat 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.
+#
+
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Added: trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/example/ClusterStaticOnewayExample.java
===================================================================
--- trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/example/ClusterStaticOnewayExample.java (rev 0)
+++ trunk/examples/jms/clustered-static-oneway/src/org/hornetq/jms/example/ClusterStaticOnewayExample.java 2010-12-09 18:29:12 UTC (rev 10028)
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat 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.hornetq.jms.example;
+
+import org.hornetq.common.example.HornetQExample;
+
+import javax.jms.*;
+import javax.naming.InitialContext;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster. The cluster is created from a static list of nodes.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public class ClusterStaticOnewayExample extends HornetQExample
+{
+ public static void main(final String[] args)
+ {
+ new ClusterStaticOnewayExample().run(args);
+ }
+
+ @Override
+ public boolean runExample() throws Exception
+ {
+ Connection initialConnection = null;
+
+ Connection connection0 = null;
+
+ Connection connection1 = null;
+
+ Connection connection2 = null;
+
+ Connection connection3 = null;
+
+ InitialContext ic0 = null;
+ Thread.sleep(5000);
+ try
+ {
+ // Step 1. Get an initial context for looking up JNDI from server 0
+ ic0 = getContext(0);
+
+ // Step 2. Look-up the JMS Queue object from JNDI
+ Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");
+
+ // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+ ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");
+
+ //grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
+ // equal load balance we do this and then create 4 connections round robined
+ initialConnection = cf0.createConnection();
+
+ Thread.sleep(2000);
+ // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+ connection0 = cf0.createConnection();
+
+ // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+ connection1 = cf0.createConnection();
+
+ // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+ connection2 = cf0.createConnection();
+
+ // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+ connection3 = cf0.createConnection();
+
+ // Step 8. We create a JMS Session on server 0
+ Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // Step 9. We create a JMS Session on server 1
+ Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+
+ // Step 8. We create a JMS Session on server 0
+ Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // Step 9. We create a JMS Session on server 1
+ Session session3 = connection3.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // Step 10. We start the connections to ensure delivery occurs on them
+ connection0.start();
+
+ connection1.start();
+
+ connection2.start();
+
+ connection3.start();
+
+ // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+ MessageConsumer consumer0 = session0.createConsumer(queue);
+
+ MessageConsumer consumer1 = session1.createConsumer(queue);
+
+ MessageConsumer consumer2 = session2.createConsumer(queue);
+
+ MessageConsumer consumer3 = session3.createConsumer(queue);
+
+ Thread.sleep(2000);
+
+ // Step 12. We create a JMS MessageProducer object on server 3
+ MessageProducer producer = session3.createProducer(queue);
+
+ // Step 13. We send some messages to server 0
+
+ final int numMessages = 20;
+
+ 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());
+ }
+ Thread.sleep(2000);
+ // Step 14. 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
+ // JMS Queues implement point-to-point message where each message is only ever consumed by a
+ // maximum of one consumer
+ int con0Node = getServer(connection0);
+ int con1Node = getServer(connection1);
+ int con2Node = getServer(connection2);
+ int con3Node = getServer(connection3);
+
+ if(con0Node + con1Node + con2Node + con3Node != 6)
+ {
+ return false;
+ }
+ for (int i = 0; i < numMessages; i += 4)
+ {
+ TextMessage message0 = (TextMessage)consumer0.receive(5000);
+
+ System.out.println("Got message: " + message0.getText() + " from node " + con0Node);
+
+ TextMessage message1 = (TextMessage)consumer1.receive(5000);
+
+ System.out.println("Got message: " + message1.getText() + " from node " + con1Node);
+
+ TextMessage message2 = (TextMessage)consumer2.receive(5000);
+
+ System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
+
+ TextMessage message3 = (TextMessage)consumer3.receive(5000);
+
+ System.out.println("Got message: " + message3.getText() + " from node " + con3Node);
+ }
+
+ return true;
+ }
+ finally
+ {
+ // Step 15. Be sure to close our resources!
+
+ if (initialConnection != null)
+ {
+ initialConnection.close();
+ }
+
+ if (connection0 != null)
+ {
+ connection0.close();
+ }
+
+ if (connection1 != null)
+ {
+ connection1.close();
+ }
+
+ if (connection2 != null)
+ {
+ connection2.close();
+ }
+
+ if (connection3 != null)
+ {
+ connection3.close();
+ }
+
+ if (ic0 != null)
+ {
+ ic0.close();
+ }
+ }
+ }
+
+}
14 years, 1 month
JBoss hornetq SVN: r10027 - trunk/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-09 13:28:27 -0500 (Thu, 09 Dec 2010)
New Revision: 10027
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
Log:
oops
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-12-09 18:27:39 UTC (rev 10026)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-12-09 18:28:27 UTC (rev 10027)
@@ -654,7 +654,6 @@
*/
public void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws HornetQException
{
- System.err.println("Flow Control being called with clientWindowsize = " + clientWindowSize + " flowControl = " + messageBytes);
if (clientWindowSize >= 0)
{
creditsToSend += messageBytes;
14 years, 1 month
JBoss hornetq SVN: r10026 - trunk/src/config/common/schema.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 13:27:39 -0500 (Thu, 09 Dec 2010)
New Revision: 10026
Modified:
trunk/src/config/common/schema/hornetq-configuration.xsd
Log:
allow cluster connections with no discovery set or connectors
Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 18:26:42 UTC (rev 10025)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 18:27:39 UTC (rev 10026)
@@ -361,7 +361,7 @@
<xsd:element maxOccurs="1" minOccurs="0" name="confirmation-window-size" type="xsd:int">
</xsd:element>
<xsd:choice>
- <xsd:element maxOccurs="1" minOccurs="1" name="static-connectors">
+ <xsd:element maxOccurs="1" minOccurs="0" name="static-connectors">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="connector-ref" type="xsd:string"/>
@@ -369,7 +369,7 @@
<xsd:attribute name="allow-direct-connections-only" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="1" name="discovery-group-ref">
+ <xsd:element maxOccurs="1" minOccurs="0" name="discovery-group-ref">
<xsd:complexType>
<xsd:attribute name="discovery-group-name" type="xsd:IDREF" use="required">
</xsd:attribute>
14 years, 1 month
JBoss hornetq SVN: r10025 - trunk/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 13:26:42 -0500 (Thu, 09 Dec 2010)
New Revision: 10025
Modified:
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
Log:
use no locator if static list exists but is empty
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-09 17:55:46 UTC (rev 10024)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-09 18:26:42 UTC (rev 10025)
@@ -734,7 +734,7 @@
ServerLocatorInternal serverLocator;
- if (config.getStaticConnectors() != null)
+ if (config.getStaticConnectors() != null && config.getStaticConnectors().size() > 0)
{
TransportConfiguration[] tcConfigs = connectorNameListToArray(config.getStaticConnectors());
14 years, 1 month
JBoss hornetq SVN: r10024 - in trunk: src/config/common/schema and 1 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 12:55:46 -0500 (Thu, 09 Dec 2010)
New Revision: 10024
Modified:
trunk/examples/jms/clustered-static-discovery/server3/hornetq-configuration.xml
trunk/src/config/common/schema/hornetq-configuration.xsd
trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
Log:
config fixes
Modified: trunk/examples/jms/clustered-static-discovery/server3/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/clustered-static-discovery/server3/hornetq-configuration.xml 2010-12-09 17:15:38 UTC (rev 10023)
+++ trunk/examples/jms/clustered-static-discovery/server3/hornetq-configuration.xml 2010-12-09 17:55:46 UTC (rev 10024)
@@ -46,7 +46,7 @@
<use-duplicate-detection>true</use-duplicate-detection>
<forward-when-no-consumers>true</forward-when-no-consumers>
<max-hops>1</max-hops>
- <static-connectors allow-direct-connections-only="false">
+ <static-connectors>
<connector-ref>server0-connector</connector-ref>
</static-connectors>
</cluster-connection>
Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 17:15:38 UTC (rev 10023)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 17:55:46 UTC (rev 10024)
@@ -366,7 +366,7 @@
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="connector-ref" type="xsd:string"/>
</xsd:sequence>
- <xsd:attribute name="allow-direct-connections" type="xsd:boolean" use="optional"/>
+ <xsd:attribute name="allow-direct-connections-only" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="discovery-group-ref">
Modified: trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 17:15:38 UTC (rev 10023)
+++ trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 17:55:46 UTC (rev 10024)
@@ -1003,7 +1003,7 @@
List<String> staticConnectorNames = new ArrayList<String>();
- boolean allowDirectConnectionsOnly = true;
+ boolean allowDirectConnectionsOnly = false;
NodeList children = e.getChildNodes();
@@ -1018,8 +1018,10 @@
else if (child.getNodeName().equals("static-connectors"))
{
Node attr = child.getAttributes().getNamedItem("allow-direct-connections-only");
-
- allowDirectConnectionsOnly = "true".equalsIgnoreCase(attr.getNodeValue()) || allowDirectConnectionsOnly;
+ if(attr != null)
+ {
+ allowDirectConnectionsOnly = "true".equalsIgnoreCase(attr.getNodeValue()) || allowDirectConnectionsOnly;
+ }
getStaticConnectors(staticConnectorNames, child);
}
}
14 years, 1 month
JBoss hornetq SVN: r10023 - trunk/src/main/org/hornetq/core/deployers/impl.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 12:15:38 -0500 (Thu, 09 Dec 2010)
New Revision: 10023
Modified:
trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
Log:
change flag to true
Modified: trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 16:55:56 UTC (rev 10022)
+++ trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 17:15:38 UTC (rev 10023)
@@ -1003,7 +1003,7 @@
List<String> staticConnectorNames = new ArrayList<String>();
- boolean allowDirectConnectionsOnly = false;;
+ boolean allowDirectConnectionsOnly = true;
NodeList children = e.getChildNodes();
14 years, 1 month
JBoss hornetq SVN: r10022 - in trunk: examples/common and 12 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-12-09 11:55:56 -0500 (Thu, 09 Dec 2010)
New Revision: 10022
Modified:
trunk/docs/user-manual/en/clusters.xml
trunk/examples/common/build.xml
trunk/examples/common/src/org/hornetq/common/example/HornetQExample.java
trunk/examples/jms/multiple-failover/src/org/hornetq/jms/example/MultipleFailoverExample.java
trunk/src/config/common/schema/hornetq-configuration.xsd
trunk/src/main/org/hornetq/core/config/ClusterConnectionConfiguration.java
trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterHeadersRemovedTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
Log:
added flag for one way clusters
Modified: trunk/docs/user-manual/en/clusters.xml
===================================================================
--- trunk/docs/user-manual/en/clusters.xml 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/docs/user-manual/en/clusters.xml 2010-12-09 16:55:56 UTC (rev 10022)
@@ -306,8 +306,8 @@
one server that you know will always be available or a list of servers where at least one will
be available.</para>
<para>This doesn't mean that you have to know where all your servers are going to be hosted, you
- can configure these server to use the reliable servers to connect to. Once they are connected and
- there where abouts will be propagated via the server it connects to</para>
+ can configure these servers to use the reliable servers to connect to. Once they are connected
+ there connection details will be propagated via the server it connects to</para>
<section>
<title>Configuring a Cluster Connection</title>
</section>
Modified: trunk/examples/common/build.xml
===================================================================
--- trunk/examples/common/build.xml 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/examples/common/build.xml 2010-12-09 16:55:56 UTC (rev 10022)
@@ -146,6 +146,7 @@
<jvmarg value="-Dhornetq.example.server.args=${server.args}"/>
<jvmarg value="-Dhornetq.example.logserveroutput=${hornetq.example.logserveroutput}"/>
<jvmarg value="-Dhornetq.example.runServer=${hornetq.example.runServer}"/>
+ <!--<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>-->
<!--<jvmarg value="-Dserver1=true"/>-->
<arg line="${hornetq.example.beans.file}"/>
<sysproperty key="java.library.path" value="${java.library.path}${path.separator}${aio.library.path}"/>
Modified: trunk/examples/common/src/org/hornetq/common/example/HornetQExample.java
===================================================================
--- trunk/examples/common/src/org/hornetq/common/example/HornetQExample.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/examples/common/src/org/hornetq/common/example/HornetQExample.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -12,11 +12,16 @@
*/
package org.hornetq.common.example;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.core.client.impl.DelegatingSession;
+import org.hornetq.jms.client.HornetQConnection;
+
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import java.util.logging.Logger;
+import javax.jms.Connection;
import javax.naming.InitialContext;
/**
@@ -214,6 +219,15 @@
server.destroy();
}
+
+ protected int getServer(Connection connection)
+ {
+ DelegatingSession session = (DelegatingSession) ((HornetQConnection) connection).getInitialSession();
+ TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
+ String port = (String) transportConfiguration.getParams().get("port");
+ return Integer.valueOf(port) - 5445;
+ }
+
private void reportResultAndExit()
{
if (failure)
Modified: trunk/examples/jms/multiple-failover/src/org/hornetq/jms/example/MultipleFailoverExample.java
===================================================================
--- trunk/examples/jms/multiple-failover/src/org/hornetq/jms/example/MultipleFailoverExample.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/examples/jms/multiple-failover/src/org/hornetq/jms/example/MultipleFailoverExample.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -160,11 +160,4 @@
}
}
- private int getServer(Connection connection)
- {
- DelegatingSession session = (DelegatingSession) ((HornetQConnection) connection).getInitialSession();
- TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
- String port = (String) transportConfiguration.getParams().get("port");
- return Integer.valueOf(port) - 5445;
- }
}
Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-09 16:55:56 UTC (rev 10022)
@@ -366,6 +366,7 @@
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="connector-ref" type="xsd:string"/>
</xsd:sequence>
+ <xsd:attribute name="allow-direct-connections" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="discovery-group-ref">
Modified: trunk/src/main/org/hornetq/core/config/ClusterConnectionConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/ClusterConnectionConfiguration.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/src/main/org/hornetq/core/config/ClusterConnectionConfiguration.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -49,6 +49,8 @@
private final int confirmationWindowSize;
+ private final boolean allowDirectConnectionsOnly;
+
public ClusterConnectionConfiguration(final String name,
final String address,
final String connectorName,
@@ -57,7 +59,8 @@
final boolean forwardWhenNoConsumers,
final int maxHops,
final int confirmationWindowSize,
- final List<String> staticConnectors)
+ final List<String> staticConnectors,
+ final boolean allowDirectConnectionsOnly)
{
this.name = name;
this.address = address;
@@ -69,6 +72,7 @@
discoveryGroupName = null;
this.maxHops = maxHops;
this.confirmationWindowSize = confirmationWindowSize;
+ this.allowDirectConnectionsOnly = allowDirectConnectionsOnly;
}
public ClusterConnectionConfiguration(final String name,
@@ -91,6 +95,7 @@
this.staticConnectors = null;
this.maxHops = maxHops;
this.confirmationWindowSize = confirmationWindowSize;
+ allowDirectConnectionsOnly = false;
}
public String getName()
@@ -142,4 +147,9 @@
{
return retryInterval;
}
+
+ public boolean isAllowDirectConnectionsOnly()
+ {
+ return allowDirectConnectionsOnly;
+ }
}
Modified: trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -1002,6 +1002,8 @@
String discoveryGroupName = null;
List<String> staticConnectorNames = new ArrayList<String>();
+
+ boolean allowDirectConnectionsOnly = false;;
NodeList children = e.getChildNodes();
@@ -1015,6 +1017,9 @@
}
else if (child.getNodeName().equals("static-connectors"))
{
+ Node attr = child.getAttributes().getNamedItem("allow-direct-connections-only");
+
+ allowDirectConnectionsOnly = "true".equalsIgnoreCase(attr.getNodeValue()) || allowDirectConnectionsOnly;
getStaticConnectors(staticConnectorNames, child);
}
}
@@ -1031,7 +1036,8 @@
forwardWhenNoConsumers,
maxHops,
confirmationWindowSize,
- staticConnectorNames);
+ staticConnectorNames,
+ allowDirectConnectionsOnly);
}
else
{
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -45,6 +45,7 @@
import org.hornetq.core.server.group.impl.Response;
import org.hornetq.core.server.management.ManagementService;
import org.hornetq.core.server.management.Notification;
+import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.TypedProperties;
import org.hornetq.utils.UUID;
@@ -98,7 +99,7 @@
private final TransportConfiguration connector;
- private final boolean allowsDirectConnectionsOnly;
+ private final boolean allowDirectConnectionsOnly;
private final Set<TransportConfiguration> allowableConnections = new HashSet<TransportConfiguration>();
@@ -110,7 +111,7 @@
final boolean useDuplicateDetection,
final boolean routeWhenNoConsumers,
final int confirmationWindowSize,
- final org.hornetq.utils.ExecutorFactory executorFactory,
+ final ExecutorFactory executorFactory,
final HornetQServer server,
final PostOffice postOffice,
final ManagementService managementService,
@@ -119,7 +120,8 @@
final UUID nodeUUID,
final boolean backup,
final String clusterUser,
- final String clusterPassword) throws Exception
+ final String clusterPassword,
+ final boolean allowDirectConnectionsOnly) throws Exception
{
if (nodeUUID == null)
@@ -131,6 +133,7 @@
this.serverLocator = serverLocator;
+ this.allowDirectConnectionsOnly = allowDirectConnectionsOnly;
if (this.serverLocator != null)
{
this.serverLocator.setClusterConnection(true);
@@ -145,8 +148,7 @@
// a cluster connection will connect to other nodes only if they are directly connected
// through a static list of connectors or broadcasting using UDP.
TransportConfiguration[] transportConfigurations = serverLocator.getStaticTransportConfigurations();
- allowsDirectConnectionsOnly = (transportConfigurations != null);
- if(allowsDirectConnectionsOnly)
+ if(this.allowDirectConnectionsOnly)
{
for (TransportConfiguration transportConfiguration : transportConfigurations)
{
@@ -154,10 +156,6 @@
}
}
}
- else
- {
- allowsDirectConnectionsOnly = false;
- }
this.connector = connector;
@@ -370,7 +368,7 @@
server.getClusterManager().notifyNodeUp(nodeID, connectorPair, last, distance);
// if the node is more than 1 hop away, we do not create a bridge for direct cluster connection
- if (allowsDirectConnectionsOnly && distance > 1 && !allowableConnections.contains(connectorPair.a))
+ if (allowDirectConnectionsOnly && distance > 1 && !allowableConnections.contains(connectorPair.a))
{
return;
}
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -783,7 +783,8 @@
nodeUUID,
backup,
server.getConfiguration().getClusterUser(),
- server.getConfiguration().getClusterPassword());
+ server.getConfiguration().getClusterPassword(),
+ config.isAllowDirectConnectionsOnly());
managementService.registerCluster(clusterConnection, config);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterHeadersRemovedTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterHeadersRemovedTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterHeadersRemovedTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -55,8 +55,8 @@
public void testHeadersRemoved() throws Exception
{
- setupClusterConnection("cluster1", 0, 1, "queues", false, 1, isNetty());
- setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty());
+ setupClusterConnection("cluster1", 0, 1, "queues", false, 1, isNetty(), false);
+ setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty(), false);
startServers(1, 0);
setupSessionFactory(0, isNetty());
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -1619,7 +1619,8 @@
final String address,
final boolean forwardWhenNoConsumers,
final int maxHops,
- final boolean netty)
+ final boolean netty,
+ final boolean allowDirectConnectionsOnly)
{
HornetQServer serverFrom = servers[nodeFrom];
@@ -1649,7 +1650,7 @@
forwardWhenNoConsumers,
maxHops,
1024,
- pairs);
+ pairs, allowDirectConnectionsOnly);
serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
}
@@ -1688,7 +1689,7 @@
forwardWhenNoConsumers,
maxHops,
1024,
- pairs);
+ pairs, false);
serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
}
@@ -1727,7 +1728,7 @@
forwardWhenNoConsumers,
maxHops,
1024,
- pairs);
+ pairs, false);
serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -67,16 +67,16 @@
public void testBasicRoundRobin() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -104,16 +104,16 @@
public void testBasicNonLoadBalanced() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -137,16 +137,16 @@
public void testRoundRobinForwardWhenNoConsumersTrue() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", true, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", true, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", true, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", true, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -168,16 +168,16 @@
public void testRoundRobinForwardWhenNoConsumersFalseNoLocalQueue() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(4, "queues.testaddress", "queue0", null, false);
@@ -194,16 +194,16 @@
public void testRoundRobinForwardWhenNoConsumersFalse() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -227,16 +227,16 @@
public void testRoundRobinForwardWhenNoConsumersFalseLocalConsumer() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -260,16 +260,16 @@
public void testHopsTooLow() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 3, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 3, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 3, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 3, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -288,16 +288,16 @@
public void testStartStopMiddleOfChain() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
setupSessionFactory(0, isNetty());
- setupSessionFactory(4, isNetty());
+ setupSessionFactory(4, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -347,11 +347,11 @@
public void testChainClusterConnections() throws Exception
{
- setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty());
- setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty());
- setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty());
- setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty());
- setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty());
+ 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);
startServers(0, 1, 2, 3, 4);
Thread.sleep(2000);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -39,9 +39,9 @@
setupServer(1, isFileStorage(), isNetty());
// server #0 is connected to server #1
- setupClusterConnection("cluster1", 0, 1, "queues", false, 1, isNetty());
+ setupClusterConnection("cluster1", 0, 1, "queues", false, 1, isNetty(), true);
// server #1 is connected to nobody
- setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty());
+ setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty(), true);
}
@Override
@@ -58,7 +58,7 @@
super.tearDown();
}
- protected boolean isNetty()
+ protected boolean isNetty()
{
return false;
}
@@ -80,8 +80,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String myFilter = "zebra";
@@ -102,8 +102,8 @@
{
startServers(0, 1);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String myFilter = "bison";
@@ -124,8 +124,8 @@
{
startServers(0, 1);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String myFilter = "bison";
@@ -161,7 +161,7 @@
Assert.assertTrue("Took too long to restart", end - start <= 5000);
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(1, isNetty(), true);
waitForBindings(0, "queues.testaddress", 0, 0, false);
@@ -185,8 +185,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
addConsumer(0, 0, "queue0", null);
@@ -205,8 +205,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
@@ -234,8 +234,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(1, "queues.testaddress", "queue0", null, false);
@@ -273,8 +273,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -314,8 +314,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -377,8 +377,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -457,7 +457,7 @@
{
startServers(1);
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(1, isNetty(), true);
createQueue(1, "queues.testaddress", "queue5", null, false);
createQueue(1, "queues.testaddress", "queue6", null, false);
@@ -483,7 +483,7 @@
waitForBindings(0, "queues.testaddress", 8, 8, false);
- setupSessionFactory(0, isNetty());
+ setupSessionFactory(0, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -520,7 +520,7 @@
{
startServers(0);
- setupSessionFactory(0, isNetty());
+ setupSessionFactory(0, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -544,7 +544,7 @@
startServers(1);
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(1, isNetty(), true);
createQueue(1, "queues.testaddress", "queue5", null, false);
createQueue(1, "queues.testaddress", "queue6", null, false);
@@ -583,8 +583,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(1, "queues.testaddress", "queue1", null, false);
@@ -618,8 +618,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String filter1 = "giraffe";
String filter2 = "aardvark";
@@ -679,8 +679,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String filter1 = "giraffe";
String filter2 = "aardvark";
@@ -743,8 +743,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -775,14 +775,14 @@
public void testRouteWhenNoConsumersTrueNonBalancedQueues() throws Exception
{
// server #0 is connected to server #1
- setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty());
+ setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
// server #1 is connected to nobody
- setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty());
+ setupClusterConnection("clusterX", 1, -1, "queues", false, 1, isNetty(), true);
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -814,8 +814,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -853,8 +853,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -888,8 +888,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -918,8 +918,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -953,12 +953,12 @@
{
servers[0].getConfiguration().getClusterConfigurations().clear();
// server #0 is connected to server #1
- setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty());
+ setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -992,12 +992,12 @@
{
servers[0].getConfiguration().getClusterConfigurations().clear();
// server #0 is connected to server #1
- setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty());
+ setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true);
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
createQueue(0, "queues.testaddress", "queue0", null, false);
createQueue(0, "queues.testaddress", "queue1", null, false);
@@ -1026,8 +1026,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String filter1 = "giraffe";
String filter2 = "aardvark";
@@ -1083,8 +1083,8 @@
{
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
String filter1 = "giraffe";
String filter2 = "aardvark";
@@ -1146,13 +1146,13 @@
public void testMultipleClusterConnections() throws Exception
{
- setupClusterConnection("cluster2", 0, 1, "q2", false, 1, isNetty());
- setupClusterConnection("cluster3", 0, 1, "q3", false, 1, isNetty());
+ setupClusterConnection("cluster2", 0, 1, "q2", false, 1, isNetty(), true);
+ setupClusterConnection("cluster3", 0, 1, "q3", false, 1, isNetty(), true);
startServers(1, 0);
- setupSessionFactory(0, isNetty());
- setupSessionFactory(1, isNetty());
+ setupSessionFactory(0, isNetty(), true);
+ setupSessionFactory(1, isNetty(), true);
// Make sure the different connections don't conflict
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -45,8 +45,8 @@
protected void setupClusters()
{
- setupClusterConnection("cluster0", 0, 1, "queues", false, 1, isNetty());
- setupClusterConnection("cluster1", 1, 0, "queues", false, 1, isNetty());
+ setupClusterConnection("cluster0", 0, 1, "queues", false, 1, isNetty(), false);
+ setupClusterConnection("cluster1", 1, 0, "queues", false, 1, isNetty(), false);
}
@Override
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -139,7 +139,7 @@
ArrayList<String> staticConnectors = new ArrayList<String>();
staticConnectors.add(liveConnector.getName());
ClusterConnectionConfiguration cccLive = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1,
- staticConnectors);
+ staticConnectors, false);
backupConfig.getClusterConfigurations().add(cccLive);
backupServer = createBackupServer();
@@ -174,7 +174,7 @@
liveConfig.setClustered(true);
List<String> pairs = null;
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
liveConfig.getClusterConfigurations().add(ccc0);
liveConfig.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
liveServer = createLiveServer();
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -149,7 +149,7 @@
config1.getConnectorConfigurations().put(connector.getName(), connector);
clusterNodes.add(connector.getName());
}
- ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, clusterNodes);
+ ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, clusterNodes, false);
config1.getClusterConfigurations().add(ccc1);
config1.setBindingsDirectory(config1.getBindingsDirectory() + "_" + liveNode);
@@ -178,7 +178,7 @@
}
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -63,7 +63,7 @@
false,
1,
1,
- new ArrayList<String>()));
+ new ArrayList<String>(), false));
return config;
}
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -174,7 +174,7 @@
config1.getConnectorConfigurations().put(connector.getName(), connector);
clusterNodes.add(connector.getName());
}
- ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, clusterNodes);
+ ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, clusterNodes, false);
config1.getClusterConfigurations().add(ccc1);
@@ -206,7 +206,7 @@
}
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -183,7 +183,7 @@
}
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
@@ -270,7 +270,7 @@
TransportConfiguration backupConnector = createTransportConfiguration(true, false, generateParams(nodeid, true));
List<String> pairs = null;
ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1,
- createClusterConnections? staticConnectors:pairs);
+ createClusterConnections? staticConnectors:pairs, false);
config1.getClusterConfigurations().add(ccc1);
config1.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -116,7 +116,7 @@
staticConnectors.add(liveConnector.getName());
}
TransportConfiguration backupConnector = createTransportConfiguration(isNetty(), false, generateParams(nodeid, isNetty()));
- ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, staticConnectors);
+ ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, staticConnectors, false);
config1.getClusterConfigurations().add(ccc1);
config1.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
@@ -146,7 +146,7 @@
}
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -77,7 +77,7 @@
false,
1,
1,
- new ArrayList<String>()));
+ new ArrayList<String>(), false));
return config;
}
@@ -111,7 +111,7 @@
false,
1,
1,
- connectors));
+ connectors, false));
return config;
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -363,7 +363,7 @@
ArrayList<String> staticConnectors = new ArrayList<String>();
staticConnectors.add(livetc.getName());
ClusterConnectionConfiguration cccBackup = new ClusterConnectionConfiguration("cluster1", "jms", backuptc.getName(), -1, false, false, 1, 1,
- staticConnectors);
+ staticConnectors, false);
backupConf.getClusterConfigurations().add(cccBackup);
backupConf.setSecurityEnabled(false);
@@ -396,7 +396,7 @@
.add(liveAcceptortc);
List<String> pairs = null;
ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", livetc.getName(), -1, false, false, 1, 1,
- pairs);
+ pairs, false);
liveConf.getClusterConfigurations().add(ccc0);
liveConf.setSharedStore(true);
liveConf.setJournalType(getDefaultJournalType());
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -211,7 +211,7 @@
RandomUtil.randomBoolean(),
RandomUtil.randomPositiveInt(),
RandomUtil.randomPositiveInt(),
- connectors);
+ connectors, false);
String discoveryGroupName = RandomUtil.randomString();
DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(discoveryGroupName, null, "230.1.2.3", 6745, 500, 0);
Modified: trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2010-12-09 16:47:56 UTC (rev 10021)
+++ trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2010-12-09 16:55:56 UTC (rev 10022)
@@ -154,7 +154,7 @@
true,
MAX_HOPS,
1024,
- toOtherServerPair));
+ toOtherServerPair, false));
JMSConfigurationImpl jmsconfig = new JMSConfigurationImpl();
@@ -199,7 +199,7 @@
true,
MAX_HOPS,
1024,
- toOtherServerPair));
+ toOtherServerPair, false));
JMSConfigurationImpl jmsconfig = new JMSConfigurationImpl();
14 years, 1 month