JBoss hornetq SVN: r10165 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/ra and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-01-31 05:13:37 -0500 (Mon, 31 Jan 2011)
New Revision: 10165
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
Log:
https://issues.jboss.org/browse/JBPAPP-5836 - make sure if a different connector class not to use orginal default params
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-01-31 06:54:56 UTC (rev 10164)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-01-31 10:13:37 UTC (rev 10165)
@@ -1387,9 +1387,17 @@
if (connectorClassName != null)
{
- Map<String, Object> connectionParams =
+ Map<String, Object> connectionParams;
+ if(raProperties.getConnectorClassName().equals(overrideProperties.getConnectorClassName()))
+ {
+
+ connectionParams =
overrideConnectionParameters(raProperties.getParsedConnectionParameters(),overrideProperties.getParsedConnectionParameters());
-
+ }
+ else
+ {
+ connectionParams = overrideProperties.getParsedConnectionParameters();
+ }
TransportConfiguration transportConf = new TransportConfiguration(connectorClassName, connectionParams);
if (ha)
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-01-31 06:54:56 UTC (rev 10164)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-01-31 10:13:37 UTC (rev 10165)
@@ -55,7 +55,7 @@
super.setUp();
clearData();
locator = createInVMNonHALocator();
- configuration = createDefaultConfig();
+ configuration = createDefaultConfig(true);
configuration.setSecurityEnabled(isSecure());
server = createServer(true, configuration);
server.start();
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java 2011-01-31 06:54:56 UTC (rev 10164)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java 2011-01-31 10:13:37 UTC (rev 10165)
@@ -213,6 +213,30 @@
assertEquals(9999l, initWait);
}
+
+ //https://issues.jboss.org/browse/JBPAPP-5836
+ public void testResourceAdapterSetupOverrideCFParams() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
+ qResourceAdapter.setConnectionParameters("server-id=0");
+ HornetQRATestBase.MyBootstrapContext ctx = new HornetQRATestBase.MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQActivationSpec spec = new HornetQActivationSpec();
+ spec.setResourceAdapter(qResourceAdapter);
+ spec.setUseJNDI(false);
+ spec.setDestinationType("javax.jms.Queue");
+ spec.setDestination(MDBQUEUE);
+ //now override the connector class
+ spec.setConnectorClassName(NETTY_CONNECTOR_FACTORY);
+ spec.setConnectionParameters("port=5445");
+ CountDownLatch latch = new CountDownLatch(1);
+ DummyMessageEndpoint endpoint = new DummyMessageEndpoint(latch);
+ DummyMessageEndpointFactory endpointFactory = new DummyMessageEndpointFactory(endpoint, false);
+ qResourceAdapter.endpointActivation(endpointFactory, spec);
+ qResourceAdapter.stop();
+ assertTrue(endpoint.released);
+ }
@Override
public boolean isSecure()
14 years, 1 month
JBoss hornetq SVN: r10164 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/ra and 1 other directory.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-01-31 01:54:56 -0500 (Mon, 31 Jan 2011)
New Revision: 10164
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/ConnectionFactoryProperties.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
Log:
JBPAPP-5790
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/ConnectionFactoryProperties.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/ConnectionFactoryProperties.java 2011-01-30 05:21:37 UTC (rev 10163)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/ConnectionFactoryProperties.java 2011-01-31 06:54:56 UTC (rev 10164)
@@ -51,11 +51,11 @@
private String discoveryAddress;
- private Integer discoveryPort;
+ private Integer discoveryPort = 9876;
- private Long discoveryRefreshTimeout;
+ private Long discoveryRefreshTimeout = new Long(10000);
- private Long discoveryInitialWaitTimeout;
+ private Long discoveryInitialWaitTimeout = new Long(10000);
private String clientID;
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java 2011-01-30 05:21:37 UTC (rev 10163)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java 2011-01-31 06:54:56 UTC (rev 10164)
@@ -12,21 +12,13 @@
*/
package org.hornetq.tests.integration.ra;
+import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.ra.HornetQResourceAdapter;
import org.hornetq.ra.inflow.HornetQActivationSpec;
-import org.hornetq.tests.util.ServiceTestBase;
import javax.resource.ResourceException;
-import javax.resource.spi.BootstrapContext;
-import javax.resource.spi.ResourceAdapterInternalException;
-import javax.resource.spi.UnavailableException;
-import javax.resource.spi.XATerminator;
import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.xa.XAResource;
import java.lang.reflect.Method;
-import java.util.Timer;
import java.util.concurrent.CountDownLatch;
/**
@@ -169,6 +161,59 @@
assertEquals(qResourceAdapter.getUserName(), testuser);
}
+ //https://issues.jboss.org/browse/JBPAPP-5790
+ public void testResourceAdapterSetup() throws Exception
+ {
+ HornetQResourceAdapter adapter = new HornetQResourceAdapter();
+ adapter.setDiscoveryAddress("231.1.1.1");
+ HornetQConnectionFactory factory = adapter.getDefaultHornetQConnectionFactory();
+ long initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
+ long refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
+ int port = factory.getDiscoveryGroupConfiguration().getGroupPort();
+
+ //defaults
+ assertEquals(10000l, refresh);
+ assertEquals(10000l, initWait);
+ assertEquals(9876, port);
+
+ adapter = new HornetQResourceAdapter();
+ adapter.setDiscoveryAddress("231.1.1.1");
+ adapter.setDiscoveryPort(9876);
+ adapter.setDiscoveryRefreshTimeout(1234l);
+ factory = adapter.getDefaultHornetQConnectionFactory();
+ initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
+ refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
+
+ //override refresh timeout
+ assertEquals(1234l, refresh);
+ assertEquals(10000l, initWait);
+
+ adapter = new HornetQResourceAdapter();
+ adapter.setDiscoveryAddress("231.1.1.1");
+ adapter.setDiscoveryPort(9876);
+ adapter.setDiscoveryInitialWaitTimeout(9999l);
+ factory = adapter.getDefaultHornetQConnectionFactory();
+ initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
+ refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
+
+ //override initial wait
+ assertEquals(10000l, refresh);
+ assertEquals(9999l, initWait);
+
+ adapter = new HornetQResourceAdapter();
+ adapter.setDiscoveryAddress("231.1.1.1");
+ adapter.setDiscoveryPort(9876);
+ adapter.setDiscoveryInitialWaitTimeout(9999l);
+ factory = adapter.getDefaultHornetQConnectionFactory();
+ initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
+ refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
+
+ //override initial wait
+ assertEquals(10000l, refresh);
+ assertEquals(9999l, initWait);
+
+ }
+
@Override
public boolean isSecure()
{
14 years, 1 month
JBoss hornetq SVN: r10163 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/client and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-30 00:21:37 -0500 (Sun, 30 Jan 2011)
New Revision: 10163
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
Log:
tweak on counters
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-01-30 04:39:41 UTC (rev 10162)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-01-30 05:21:37 UTC (rev 10163)
@@ -821,7 +821,7 @@
{
if (pageSubscription != null)
{
- return messagesAdded + pageSubscription.getCounter().getValue();
+ return messagesAdded + pageSubscription.getCounter().getValue() - pagedReferences.get();
}
else
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-01-30 04:39:41 UTC (rev 10162)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-01-30 05:21:37 UTC (rev 10163)
@@ -156,7 +156,7 @@
ClientSession session = sf.createSession(false, false, false);
- session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true);
+ Queue queue = server.createQueue(ADDRESS, ADDRESS, null, true, false);
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
@@ -215,6 +215,12 @@
{
sessionServer.close(true);
}
+
+
+ OperationContextImpl.getContext().waitCompletion();
+
+ assertEquals(numberOfMessages - 100, queue.getMessageCount());
+ assertEquals(numberOfMessages, queue.getMessagesAdded());
OperationContextImpl.getContext().waitCompletion();
14 years, 1 month
JBoss hornetq SVN: r10162 - in branches/Branch_2_2_EAP: hornetq-rest and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-29 23:39:41 -0500 (Sat, 29 Jan 2011)
New Revision: 10162
Modified:
branches/Branch_2_2_EAP/build-maven.xml
branches/Branch_2_2_EAP/hornetq-rest/pom.xml
branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties
Log:
upload release
Modified: branches/Branch_2_2_EAP/build-maven.xml
===================================================================
--- branches/Branch_2_2_EAP/build-maven.xml 2011-01-30 04:30:06 UTC (rev 10161)
+++ branches/Branch_2_2_EAP/build-maven.xml 2011-01-30 04:39:41 UTC (rev 10162)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.0.EAP-QA-10159"/>
+ <property name="hornetq.version" value="2.2.0.EAP-QA-10162"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: branches/Branch_2_2_EAP/hornetq-rest/pom.xml
===================================================================
--- branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-01-30 04:30:06 UTC (rev 10161)
+++ branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-01-30 04:39:41 UTC (rev 10162)
@@ -10,7 +10,7 @@
<properties>
<resteasy.version>2.0.1.GA</resteasy.version>
- <hornetq.version>2.2.0.EAP-QA-10159</hornetq.version>
+ <hornetq.version>2.2.0.EAP-QA-10162</hornetq.version>
</properties>
<licenses>
Modified: branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties
===================================================================
--- branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties 2011-01-30 04:30:06 UTC (rev 10161)
+++ branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties 2011-01-30 04:39:41 UTC (rev 10162)
@@ -1,4 +1,4 @@
-hornetq.version.versionName=QA_10159
+hornetq.version.versionName=QA_10162
hornetq.version.majorVersion=2
hornetq.version.minorVersion=2
hornetq.version.microVersion=0
14 years, 1 month
JBoss hornetq SVN: r10161 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/client and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-29 23:30:06 -0500 (Sat, 29 Jan 2011)
New Revision: 10161
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
Log:
tweak on page counters for putnam
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-01-30 04:02:14 UTC (rev 10160)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-01-30 04:30:06 UTC (rev 10161)
@@ -819,7 +819,14 @@
synchronized (this)
{
- return messagesAdded;
+ if (pageSubscription != null)
+ {
+ return messagesAdded + pageSubscription.getCounter().getValue();
+ }
+ else
+ {
+ return messagesAdded;
+ }
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-01-30 04:02:14 UTC (rev 10160)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-01-30 04:30:06 UTC (rev 10161)
@@ -363,7 +363,9 @@
assertEquals(0, errors.get());
assertEquals(numberOfMessages, q2.getMessageCount());
+ assertEquals(numberOfMessages, q2.getMessagesAdded());
assertEquals(0, q1.getMessageCount());
+ assertEquals(numberOfMessages, q1.getMessagesAdded());
session.close();
sf.close();
@@ -400,7 +402,10 @@
assertNotNull(q2);
assertEquals(numberOfMessages, q2.getMessageCount());
+ assertEquals(numberOfMessages, q2.getMessagesAdded());
assertEquals(0, q1.getMessageCount());
+ // 0, since nothing was sent to the queue after the server was restarted
+ assertEquals(0, q1.getMessagesAdded());
}
catch (Throwable e)
@@ -520,8 +525,6 @@
session.commit();
- q1.getMessageCount();
-
t1.start();
t1.join();
@@ -534,7 +537,9 @@
}
assertEquals(numberOfMessages, q2.getMessageCount());
+ assertEquals(numberOfMessages, q2.getMessagesAdded());
assertEquals(numberOfMessages - 100, q1.getMessageCount());
+ assertEquals(numberOfMessages, q2.getMessagesAdded());
}
catch (Throwable e)
14 years, 1 month
JBoss hornetq SVN: r10160 - in branches/Branch_2_2_EAP: hornetq-rest and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-29 23:02:14 -0500 (Sat, 29 Jan 2011)
New Revision: 10160
Modified:
branches/Branch_2_2_EAP/build-maven.xml
branches/Branch_2_2_EAP/hornetq-rest/pom.xml
branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties
Log:
preparing a new upload for QA
Modified: branches/Branch_2_2_EAP/build-maven.xml
===================================================================
--- branches/Branch_2_2_EAP/build-maven.xml 2011-01-30 03:33:33 UTC (rev 10159)
+++ branches/Branch_2_2_EAP/build-maven.xml 2011-01-30 04:02:14 UTC (rev 10160)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.0.EAP-QA-10154"/>
+ <property name="hornetq.version" value="2.2.0.EAP-QA-10159"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: branches/Branch_2_2_EAP/hornetq-rest/pom.xml
===================================================================
--- branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-01-30 03:33:33 UTC (rev 10159)
+++ branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-01-30 04:02:14 UTC (rev 10160)
@@ -10,7 +10,7 @@
<properties>
<resteasy.version>2.0.1.GA</resteasy.version>
- <hornetq.version>2.2.0.EAP-QA-10154</hornetq.version>
+ <hornetq.version>2.2.0.EAP-QA-10159</hornetq.version>
</properties>
<licenses>
Modified: branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties
===================================================================
--- branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties 2011-01-30 03:33:33 UTC (rev 10159)
+++ branches/Branch_2_2_EAP/src/config/common/hornetq-version.properties 2011-01-30 04:02:14 UTC (rev 10160)
@@ -1,4 +1,4 @@
-hornetq.version.versionName=Colmeia
+hornetq.version.versionName=QA_10159
hornetq.version.majorVersion=2
hornetq.version.minorVersion=2
hornetq.version.microVersion=0
14 years, 1 month
JBoss hornetq SVN: r10159 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/protocol/core/impl and 2 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-29 22:33:33 -0500 (Sat, 29 Jan 2011)
New Revision: 10159
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/HornetQClient.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
Log:
https://issues.jboss.org/browse/JBPAPP-5828 / HORNETQ-636 - ClusterBridges not Acking properly
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/HornetQClient.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/HornetQClient.java 2011-01-29 05:31:35 UTC (rev 10158)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/HornetQClient.java 2011-01-30 03:33:33 UTC (rev 10159)
@@ -13,14 +13,10 @@
package org.hornetq.api.core.client;
import org.hornetq.api.core.DiscoveryGroupConfiguration;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.client.impl.ServerLocatorImpl;
-import java.util.List;
-
/**
* Utility class for creating HornetQ {@link ClientSessionFactory} objects.
*
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2011-01-29 05:31:35 UTC (rev 10158)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2011-01-30 03:33:33 UTC (rev 10159)
@@ -74,7 +74,7 @@
private CommandConfirmationHandler commandConfirmationHandler;
private volatile boolean transferring;
-
+
public ChannelImpl(final CoreRemotingConnection connection, final long id, final int confWindowSize)
{
this.connection = connection;
@@ -153,7 +153,7 @@
}
// This must never called by more than one thread concurrently
-
+
public void send(final Packet packet, final boolean flush, final boolean batch)
{
synchronized (sendLock)
@@ -161,7 +161,7 @@
packet.setChannelID(id);
HornetQBuffer buffer = packet.encode(connection);
-
+
lock.lock();
try
@@ -193,14 +193,13 @@
{
lock.unlock();
}
-
- //The actual send must be outside the lock, or with OIO transport, the write can block if the tcp
- //buffer is full, preventing any incoming buffers being handled and blocking failover
+
+ // The actual send must be outside the lock, or with OIO transport, the write can block if the tcp
+ // buffer is full, preventing any incoming buffers being handled and blocking failover
connection.getTransportConnection().write(buffer, flush, batch);
}
}
-
public Packet sendBlocking(final Packet packet) throws HornetQException
{
if (closed)
@@ -212,7 +211,7 @@
{
throw new IllegalStateException("Cannot do a blocking call timeout on a server side connection");
}
-
+
// Synchronized since can't be called concurrently by more than one thread and this can occur
// E.g. blocking acknowledge() from inside a message handler at some time as other operation on main thread
synchronized (sendBlockingLock)
@@ -300,6 +299,10 @@
public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
{
+ if (confWindowSize < 0)
+ {
+ throw new IllegalStateException("You can't set confirmationHandler on a connection with confirmation-window-size < 0. Look at the documentation for more information.");
+ }
commandConfirmationHandler = handler;
}
@@ -501,6 +504,7 @@
lastReceivedCommandID +
" first stored command id " +
firstStoredCommandID);
+ firstStoredCommandID = lastReceivedCommandID + 1;
return;
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-01-29 05:31:35 UTC (rev 10158)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-01-30 03:33:33 UTC (rev 10159)
@@ -359,6 +359,7 @@
serverLocator.setClusterTransportConfiguration(connector);
serverLocator.setBackup(server.getConfiguration().isBackup());
serverLocator.setInitialConnectAttempts(-1);
+ serverLocator.setConfirmationWindowSize(0);
if(retryInterval > 0)
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java 2011-01-29 05:31:35 UTC (rev 10158)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java 2011-01-30 03:33:33 UTC (rev 10159)
@@ -66,13 +66,59 @@
super.tearDown();
}
+ public void testSetInvalidSendACK() throws Exception
+ {
+ ServerLocator locator = createInVMNonHALocator();
+
+ locator.setConfirmationWindowSize(-1);
+
+ ClientSessionFactory csf = locator.createSessionFactory();
+ ClientSession session = csf.createSession(null, null, false, true, true, false, 1);
+
+ try
+ {
+
+ boolean failed = false;
+ try
+ {
+ session.setSendAcknowledgementHandler(new SendAcknowledgementHandler()
+ {
+ public void sendAcknowledged(Message message)
+ {
+ }
+ });
+ }
+ catch (Throwable expected)
+ {
+ failed = true;
+ }
+
+ assertTrue("Expected a failure on setting ACK Handler", failed);
+
+ session.createQueue(address, queueName, false);
+ }
+ finally
+ {
+ session.close();
+ }
+ }
+
+ public void testSendAcknowledgementsNoWindowSize() throws Exception
+ {
+ testSendAcknowledgements(0);
+ }
+
public void testSendAcknowledgements() throws Exception
{
+ testSendAcknowledgements(1024);
+ }
+
+ public void testSendAcknowledgements(int windowSize) throws Exception
+ {
ServerLocator locator = createInVMNonHALocator();
+ locator.setConfirmationWindowSize(windowSize);
- locator.setConfirmationWindowSize(1024);
-
ClientSessionFactory csf = locator.createSessionFactory();
ClientSession session = csf.createSession(null, null, false, true, true, false, 1);
14 years, 1 month
JBoss hornetq SVN: r10158 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-29 00:31:35 -0500 (Sat, 29 Jan 2011)
New Revision: 10158
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
tweak
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2011-01-28 22:43:41 UTC (rev 10157)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2011-01-29 05:31:35 UTC (rev 10158)
@@ -20,6 +20,7 @@
import javax.jms.Session;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
@@ -28,6 +29,7 @@
import org.hornetq.core.security.Role;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQQueue;
+import org.hornetq.jms.client.HornetQQueueConnectionFactory;
/**
* A JMSServerControlUsingCoreTest
@@ -56,7 +58,79 @@
}
return names;
}
-
+
+ // The JMS test won't support the server being restarted, hence we have to do a slight different test on that case
+ public void testCreateConnectionFactory_CompleteList() throws Exception
+ {
+ JMSServerControl control = createManagementControl();
+ control.createConnectionFactory("test", //name
+ true, // ha
+ false, // useDiscovery
+ 1, // cfType
+ "invm", // connectorNames
+ "tst", // jndiBindins
+ "tst", // clientID
+ 1, // clientFailureCheckPeriod
+ 1, // connectionTTL
+ 1, // callTimeout
+ 1, // minLargeMessageSize
+ true, // compressLargeMessages
+ 1, // consumerWindowSize
+ 1, // consumerMaxRate
+ 1, // confirmationWindowSize
+ 1, // ProducerWindowSize
+ 1, // producerMaxRate
+ true, // blockOnACK
+ true, // blockOnDurableSend
+ true, // blockOnNonDurableSend
+ true, // autoGroup
+ true, // preACK
+ HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, // loadBalancingClassName
+ 1, // transactionBatchSize
+ 1, // dupsOKBatchSize
+ true, // useGlobalPools
+ 1, // scheduleThreadPoolSize
+ 1, // threadPoolMaxSize
+ 1, // retryInterval
+ 1, // retryIntervalMultiplier
+ 1, // maxRetryInterval
+ 1, // reconnectAttempts
+ true, // failoverOnInitialConnection
+ "tst"); // groupID
+
+
+ HornetQQueueConnectionFactory cf = (HornetQQueueConnectionFactory)context.lookup("tst");
+
+ assertEquals(true, cf.isHA());
+ assertEquals("tst", cf.getClientID());
+ assertEquals(1, cf.getClientFailureCheckPeriod());
+ assertEquals(1, cf.getConnectionTTL());
+ assertEquals(1, cf.getCallTimeout());
+ assertEquals(1, cf.getMinLargeMessageSize());
+ assertEquals(true, cf.isCompressLargeMessage());
+ assertEquals(1, cf.getConsumerWindowSize());
+ assertEquals(1, cf.getConfirmationWindowSize());
+ assertEquals(1, cf.getProducerWindowSize());
+ assertEquals(1, cf.getProducerMaxRate());
+ assertEquals(true, cf.isBlockOnAcknowledge());
+ assertEquals(true, cf.isBlockOnDurableSend());
+ assertEquals(true, cf.isBlockOnNonDurableSend());
+ assertEquals(true, cf.isAutoGroup());
+ assertEquals(true, cf.isPreAcknowledge());
+ assertEquals(HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, cf.getConnectionLoadBalancingPolicyClassName());
+ assertEquals(1, cf.getTransactionBatchSize());
+ assertEquals(1, cf.getDupsOKBatchSize());
+ assertEquals(true, cf.isUseGlobalPools());
+ assertEquals(1, cf.getScheduledThreadPoolMaxSize());
+ assertEquals(1, cf.getThreadPoolMaxSize());
+ assertEquals(1, cf.getRetryInterval());
+ assertEquals(1.0, cf.getRetryIntervalMultiplier());
+ assertEquals(1, cf.getMaxRetryInterval());
+ assertEquals(1, cf.getReconnectAttempts());
+ assertEquals(true, cf.isFailoverOnInitialConnection());
+ assertEquals("tst", cf.getGroupID());
+
+ }
// Constructors --------------------------------------------------
// JMSServerControlTest overrides --------------------------------
14 years, 1 month
JBoss hornetq SVN: r10157 - in branches/Branch_2_2_EAP: src/main/org/hornetq/jms/server/impl and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-01-28 17:43:41 -0500 (Fri, 28 Jan 2011)
New Revision: 10157
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
Log:
HORNETQ-616 / HORNETQ-617 - settings of connection factories through management
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2011-01-28 09:22:51 UTC (rev 10156)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2011-01-28 22:43:41 UTC (rev 10157)
@@ -523,7 +523,7 @@
try
{
- boolean destroyed = server.removeConnectionFactoryFromJNDI(name);
+ boolean destroyed = server.destroyConnectionFactory(name);
if (destroyed)
{
sendNotification(NotificationType.CONNECTION_FACTORY_DESTROYED, name);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-01-28 09:22:51 UTC (rev 10156)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-01-28 22:43:41 UTC (rev 10157)
@@ -279,7 +279,7 @@
for (String connectionFactory : new HashSet<String>(connectionFactories.keySet()))
{
- destroyConnectionFactory(connectionFactory);
+ shutdownConnectionFactory(connectionFactory);
}
connectionFactories.clear();
@@ -1108,12 +1108,29 @@
public synchronized boolean destroyConnectionFactory(final String name) throws Exception
{
+ if (!shutdownConnectionFactory(name))
+ {
+ return false;
+ }
+
+ storage.deleteConnectionFactory(name);
+
+ return true;
+ }
+
+ /**
+ * @param name
+ * @throws Exception
+ */
+ protected boolean shutdownConnectionFactory(final String name) throws Exception
+ {
checkInitialised();
List<String> jndiBindings = connectionFactoryJNDI.get(name);
if (jndiBindings == null || jndiBindings.size() == 0)
{
return false;
}
+
if (registry != null)
{
for (String jndiBinding : jndiBindings)
@@ -1126,7 +1143,7 @@
connectionFactories.remove(name);
jmsManagementService.unregisterConnectionFactory(name);
-
+
return true;
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2011-01-28 09:22:51 UTC (rev 10156)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2011-01-28 22:43:41 UTC (rev 10157)
@@ -29,6 +29,7 @@
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.XASession;
+import javax.naming.NamingException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@@ -42,6 +43,7 @@
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.QueueBinding;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
@@ -480,7 +482,7 @@
});
}
- public void testCreateConnectionFactory_CopmleteList() throws Exception
+ public void testCreateConnectionFactory_CompleteList() throws Exception
{
JMSServerControl control = createManagementControl();
control.createConnectionFactory("test", //name
@@ -553,6 +555,8 @@
stopServer();
startServer();
+
+ control = createManagementControl();
cf = (HornetQQueueConnectionFactory)context.lookup("tst");
@@ -585,6 +589,27 @@
assertEquals(true, cf.isFailoverOnInitialConnection());
assertEquals("tst", cf.getGroupID());
+ control.destroyConnectionFactory("test");
+
+ ObjectNameBuilder nameBuilder = ObjectNameBuilder.create(ConfigurationImpl.DEFAULT_JMX_DOMAIN);
+ assertFalse(mbeanServer.isRegistered(nameBuilder.getConnectionFactoryObjectName("test")));
+
+ stopServer();
+
+ startServer();
+
+ assertFalse(mbeanServer.isRegistered(nameBuilder.getConnectionFactoryObjectName("test")));
+
+
+ try
+ {
+ cf = (HornetQQueueConnectionFactory)context.lookup("tst");
+ fail("Failure expected");
+ }
+ catch (NamingException e)
+ {
+ }
+
}
14 years, 1 month
JBoss hornetq SVN: r10156 - branches/Branch_2_2_EAP/docs/eap-manual/en.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-01-28 04:22:51 -0500 (Fri, 28 Jan 2011)
New Revision: 10156
Modified:
branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml
Log:
reformatted and added max hops comment
Modified: branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml 2011-01-28 03:43:14 UTC (rev 10155)
+++ branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml 2011-01-28 09:22:51 UTC (rev 10156)
@@ -97,10 +97,10 @@
something like:
</para>
<programlisting>
- <large-messages-directory>/media/shared/data/large-messages</large-messages-directory>
- <bindings-directory>/media/shared/data/bindings</bindings-directory>
- <journal-directory>/media/shared/data/journal</journal-directory>
- <paging-directory>/media/shared/data/paging</paging-directory>
+ <large-messages-directory>/media/shared/data/large-messages</large-messages-directory>
+ <bindings-directory>/media/shared/data/bindings</bindings-directory>
+ <journal-directory>/media/shared/data/journal</journal-directory>
+ <paging-directory>/media/shared/data/paging</paging-directory>
</programlisting>
<para>
How these paths are configured will of course depend on your network settings or file system.
@@ -121,7 +121,7 @@
file like so:
</para>
<programlisting>
- <failover-on-shutdown>false</failover-on-shutdown>
+ <failover-on-shutdown>false</failover-on-shutdown>
</programlisting>
<para>Don't worry if you have this set to false (which is the default) but still want failover to occur,
simply
@@ -137,28 +137,28 @@
example:
</para>
<programlisting>
- <connection-factory name="NettyConnectionFactory">
- <xa>true</xa>
- <connectors>
- <connector-ref connector-name="netty"/>
- </connectors>
- <entries>
- <entry name="/ConnectionFactory"/>
- <entry name="/XAConnectionFactory"/>
- </entries>
+ <connection-factory name="NettyConnectionFactory">
+ <xa>true</xa>
+ <connectors>
+ <connector-ref connector-name="netty"/>
+ </connectors>
+ <entries>
+ <entry name="/ConnectionFactory"/>
+ <entry name="/XAConnectionFactory"/>
+ </entries>
- <ha>true</ha>
- <!-- Pause 1 second between connect attempts -->
- <retry-interval>1000</retry-interval>
+ <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>
+ <!-- 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>
+ <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
+ <reconnect-attempts>-1</reconnect-attempts>
+ </connection-factory>
</programlisting>
<para>We have added the following attributes to the connection factory used by the client:</para>
@@ -216,44 +216,44 @@
directory but in reality it doesn't matter where this is put. This will look like:
</para>
<programlisting>
- <?xml version="1.0" encoding="UTF-8"?>
+ <?xml version="1.0" encoding="UTF-8"?>
- <deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- The core configuration -->
- <bean name="BackupConfiguration" class="org.hornetq.core.config.impl.FileConfiguration">
- <property
- name="configurationUrl">${jboss.server.home.url}/deploy/hornetq-backup1/hornetq-configuration.xml</property>
- </bean>
+ <!-- The core configuration -->
+ <bean name="BackupConfiguration" class="org.hornetq.core.config.impl.FileConfiguration">
+ <property
+ name="configurationUrl">${jboss.server.home.url}/deploy/hornetq-backup1/hornetq-configuration.xml</property>
+ </bean>
- <!-- The core server -->
- <bean name="BackupHornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
- <constructor>
- <parameter>
- <inject bean="BackupConfiguration"/>
- </parameter>
- <parameter>
- <inject bean="MBeanServer"/>
- </parameter>
- <parameter>
- <inject bean="HornetQSecurityManager"/>
- </parameter>
- </constructor>
- <start ignored="true"/>
- <stop ignored="true"/>
- </bean>
+ <!-- The core server -->
+ <bean name="BackupHornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="BackupConfiguration"/>
+ </parameter>
+ <parameter>
+ <inject bean="MBeanServer"/>
+ </parameter>
+ <parameter>
+ <inject bean="HornetQSecurityManager"/>
+ </parameter>
+ </constructor>
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
- <!-- The JMS server -->
- <bean name="BackupJMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
- <constructor>
- <parameter>
- <inject bean="BackupHornetQServer"/>
- </parameter>
- </constructor>
- </bean>
+ <!-- The JMS server -->
+ <bean name="BackupJMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="BackupHornetQServer"/>
+ </parameter>
+ </constructor>
+ </bean>
- </deployment>
+ </deployment>
</programlisting>
<para>
The first thing to notice is the BackupConfiguration bean. This is configured to pick up the
@@ -284,101 +284,104 @@
and configure it like so:
</para>
<programlisting>
- <configuration xmlns="urn:hornetq"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
- <jmx-domain>org.hornetq.backup1</jmx-domain>
+ <jmx-domain>org.hornetq.backup1</jmx-domain>
- <clustered>true</clustered>
+ <clustered>true</clustered>
- <backup>true</backup>
+ <backup>true</backup>
- <shared-store>true</shared-store>
+ <shared-store>true</shared-store>
- <allow-failback>true</allow-failback>
+ <allow-failback>true</allow-failback>
- <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
+ <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
- <bindings-directory>/media/shared/data/hornetq-backup/bindings</bindings-directory>
+ <bindings-directory>/media/shared/data/hornetq-backup/bindings</bindings-directory>
- <journal-directory>/media/shared/data/hornetq-backup/journal</journal-directory>
+ <journal-directory>/media/shared/data/hornetq-backup/journal</journal-directory>
- <journal-min-files>10</journal-min-files>
+ <journal-min-files>10</journal-min-files>
- <large-messages-directory>/media/shared/data/hornetq-backup/largemessages</large-messages-directory>
+ <large-messages-directory>/media/shared/data/hornetq-backup/largemessages</large-messages-directory>
- <paging-directory>/media/shared/data/hornetq-backup/paging</paging-directory>
+ <paging-directory>/media/shared/data/hornetq-backup/paging</paging-directory>
- <connectors>
- <connector name="netty-connector">
- <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
- <param key="host" value="${jboss.bind.address:localhost}"/>
- <param key="port" value="${hornetq.remoting.backup.netty.port:5446}"/>
- </connector>
+ <connectors>
+ <connector name="netty-connector">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="host" value="${jboss.bind.address:localhost}"/>
+ <param key="port" value="${hornetq.remoting.backup.netty.port:5446}"/>
+ </connector>
- <connector name="in-vm">
- <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
- <param key="server-id" value="${hornetq.server-id:0}"/>
- </connector>
+ <connector name="in-vm">
+ <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+ <param key="server-id" value="${hornetq.server-id:0}"/>
+ </connector>
- </connectors>
+ </connectors>
- <acceptors>
- <acceptor name="netty">
- <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
- <param key="host" value="${jboss.bind.address:localhost}"/>
- <param key="port" value="${hornetq.remoting.backup.netty.port:5446}"/>
- </acceptor>
- </acceptors>
+ <acceptors>
+ <acceptor name="netty">
+ <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+ <param key="host" value="${jboss.bind.address:localhost}"/>
+ <param key="port" value="${hornetq.remoting.backup.netty.port:5446}"/>
+ </acceptor>
+ </acceptors>
- <broadcast-groups>
- <broadcast-group name="bg-group1">
- <group-address>231.7.7.7</group-address>
- <group-port>9876</group-port>
- <broadcast-period>1000</broadcast-period>
- <connector-ref>netty-connector</connector-ref>
- </broadcast-group>
- </broadcast-groups>
+ <broadcast-groups>
+ <broadcast-group name="bg-group1">
+ <group-address>231.7.7.7</group-address>
+ <group-port>9876</group-port>
+ <broadcast-period>1000</broadcast-period>
+ <connector-ref>netty-connector</connector-ref>
+ </broadcast-group>
+ </broadcast-groups>
- <discovery-groups>
- <discovery-group name="dg-group1">
- <group-address>231.7.7.7</group-address>
- <group-port>9876</group-port>
- <refresh-timeout>60000</refresh-timeout>
- </discovery-group>
- </discovery-groups>
+ <discovery-groups>
+ <discovery-group name="dg-group1">
+ <group-address>231.7.7.7</group-address>
+ <group-port>9876</group-port>
+ <refresh-timeout>60000</refresh-timeout>
+ </discovery-group>
+ </discovery-groups>
- <cluster-connections>
- <cluster-connection name="my-cluster">
- <address>jms</address>
- <connector-ref>netty-connector</connector-ref>
- <discovery-group-ref discovery-group-name="dg-group1"/>
- </cluster-connection>
- </cluster-connections>
+ <cluster-connections>
+ <cluster-connection name="my-cluster">
+ <address>jms</address>
+ <connector-ref>netty-connector</connector-ref>
+ <discovery-group-ref discovery-group-name="dg-group1"/>
+ <!--max hops defines how messages are redistributed, the default is 1 meaning only distribute to directly
+ connected nodes, to disable set to 0-->
+ <!--<max-hops>0</max-hops>-->
+ </cluster-connection>
+ </cluster-connections>
- <security-settings>
- <security-setting match="#">
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
+ <security-settings>
+ <security-setting match="#">
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
- <address-settings>
- <!--default for catch all-->
- <address-setting match="#">
- <dead-letter-address>jms.queue.DLQ</dead-letter-address>
- <expiry-address>jms.queue.ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <max-size-bytes>10485760</max-size-bytes>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>BLOCK</address-full-policy>
- </address-setting>
- </address-settings>
+ <address-settings>
+ <!--default for catch all-->
+ <address-setting match="#">
+ <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+ <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+ <redelivery-delay>0</redelivery-delay>
+ <max-size-bytes>10485760</max-size-bytes>
+ <message-counter-history-day-limit>10</message-counter-history-day-limit>
+ <address-full-policy>BLOCK</address-full-policy>
+ </address-setting>
+ </address-settings>
- </configuration>
+ </configuration>
</programlisting>
<para>
@@ -430,6 +433,10 @@
The Broadcast groups, Discovery group and cluster configurations are as per normal, details of these
can be found in the HornetQ user manual.
</para>
+ <note>
+ <para>notice the commented out <literal>max-hops</literal> in the cluster connection, set this to 0 if
+ you want to disable server side load balancing.</para>
+ </note>
<para>
When the backup becomes it will be not be servicing any JEE components on this eap instance. Instead any
existing messages will be redistributed around the cluster and new messages forwarded to and from the backup
@@ -524,26 +531,26 @@
as in the last diagram. Then simply edit the <literal>jms-ds.xml</literal> and change the following lines to
</para>
<programlisting>
- <config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
- <config-property name="ConnectionParameters" type="java.lang.String">host=127.0.0.1;port=5446</config-property>
+ <config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
+ <config-property name="ConnectionParameters" type="java.lang.String">host=127.0.0.1;port=5446</config-property>
</programlisting>
<para>
This will change the outbound JCA connector, to configure the inbound connector for MDB's edit the
<literal>ra.xml</literal> config file and change the following parameters.
</para>
<programlisting>
- <config-property>
- <description>The transport type</description>
- <config-property-name>ConnectorClassName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
- </config-property>
- <config-property>
- <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
- <config-property-name>ConnectionParameters</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>host=127.0.0.1;port=5446</config-property-value>
- </config-property>
+ <config-property>
+ <description>The transport type</description>
+ <config-property-name>ConnectorClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
+ <config-property-name>ConnectionParameters</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>host=127.0.0.1;port=5446</config-property-value>
+ </config-property>
</programlisting>
<para>
In both cases the host and port should match your live server. If you are using Discovery then set the
14 years, 1 month