Author: clebert.suconic(a)jboss.com
Date: 2011-01-21 13:54:45 -0500 (Fri, 21 Jan 2011)
New Revision: 10130
Added:
branches/Branch_2_2_EAP/merges.txt
Modified:
branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/HornetQServerControl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
Log:
Merge from trunk 10125:10129
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-21 18:37:12 UTC (rev
10129)
+++ branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml 2011-01-21 18:54:45 UTC (rev
10130)
@@ -314,7 +314,7 @@
<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.netty.port:5446}"/>
+ <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
</connector>
<connector name="in-vm">
@@ -328,7 +328,7 @@
<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.netty.port:5446}"/>
+ <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
</acceptor>
</acceptors>
@@ -382,7 +382,7 @@
</programlisting>
<para>
- The first thing you can see is we have added a
+ The second thing you can see is we have added a
<literal>jmx-domain</literal>
attribute, this is used when
adding objects, such as the HornetQ server and JMS server to jmx, we
change this from the default
Added: branches/Branch_2_2_EAP/merges.txt
===================================================================
--- branches/Branch_2_2_EAP/merges.txt (rev 0)
+++ branches/Branch_2_2_EAP/merges.txt 2011-01-21 18:54:45 UTC (rev 10130)
@@ -0,0 +1,3 @@
+
+- branch source - branch target - revision interval - date - Author
+- trunk - Branch_2_2 - 10125:10129 - 20-jan-2011 - Clebert
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2011-01-21
18:37:12 UTC (rev 10129)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2011-01-21
18:54:45 UTC (rev 10130)
@@ -130,6 +130,17 @@
int getJournalBufferTimeout();
/**
+ * do any clients failover on a server shutdown
+ */
+ void setFailoverOnServerShutdown(boolean failoverOnServerShutdown) throws Exception;
+
+
+ /**
+ * returns if clients failover on a server shutdown
+ */
+ boolean isFailoverOnServerShutdown();
+
+ /**
* Returns the minimal number of journal files before compacting.
*/
int getJournalCompactMinFiles();
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2011-01-21
18:37:12 UTC (rev 10129)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2011-01-21
18:54:45 UTC (rev 10130)
@@ -268,6 +268,37 @@
}
}
+ public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
+ {
+ checkStarted();
+
+ clearIO();
+ try
+ {
+ configuration.setFailoverOnServerShutdown(failoverOnServerShutdown);
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
+
+ public boolean isFailoverOnServerShutdown()
+ {
+ checkStarted();
+
+ clearIO();
+ try
+ {
+ return configuration.isFailoverOnServerShutdown();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
public int getJournalMaxIO()
{
checkStarted();
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-01-21
18:37:12 UTC (rev 10129)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-01-21
18:54:45 UTC (rev 10130)
@@ -1344,10 +1344,8 @@
addressSettingsDeployer.start();
}
- else
- {
- deployAddressSettingsFromConfiguration();
- }
+
+ deployAddressSettingsFromConfiguration();
storageManager.start();
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2011-01-21
18:37:12 UTC (rev 10129)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2011-01-21
18:54:45 UTC (rev 10130)
@@ -44,8 +44,10 @@
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.core.transaction.impl.XidImpl;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.utils.UUIDGenerator;
import org.hornetq.utils.json.JSONArray;
import org.hornetq.utils.json.JSONObject;
@@ -141,6 +143,7 @@
Assert.assertEquals(conf.getJournalCompactMinFiles(),
serverControl.getJournalCompactMinFiles());
Assert.assertEquals(conf.getJournalCompactPercentage(),
serverControl.getJournalCompactPercentage());
Assert.assertEquals(conf.isPersistenceEnabled(),
serverControl.isPersistenceEnabled());
+ Assert.assertEquals(conf.isFailoverOnServerShutdown(),
serverControl.isFailoverOnServerShutdown());
}
public void testGetConnectors() throws Exception
@@ -765,7 +768,65 @@
Assert.assertTrue(html.matches(".*m3.*"));
Assert.assertTrue(html.matches(".*m4.*"));
}
-
+
+ public void testCommitPreparedTransactions() throws Exception
+ {
+ SimpleString recQueue = new SimpleString("BasicXaTestqRec");
+ SimpleString sendQueue = new SimpleString("BasicXaTestqSend");
+
+ byte[] globalTransactionId =
UUIDGenerator.getInstance().generateStringUUID().getBytes();
+ Xid xid = new XidImpl("xa1".getBytes(), 1, globalTransactionId);
+ Xid xid2 = new XidImpl("xa2".getBytes(), 1, globalTransactionId);
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ ClientSessionFactory csf = locator.createSessionFactory();
+ ClientSession clientSession = csf.createSession(true, false, false);
+ clientSession.createQueue(recQueue, recQueue, null, true);
+ clientSession.createQueue(sendQueue, sendQueue, null, true);
+ ClientMessage m1 = createTextMessage(clientSession, "");
+ m1.putStringProperty("m1", "m1");
+ ClientProducer clientProducer = clientSession.createProducer(recQueue);
+ clientProducer.send(m1);
+ locator.close();
+
+
+ ServerLocator receiveLocator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ ClientSessionFactory receiveCsf = receiveLocator.createSessionFactory();
+ ClientSession receiveClientSession = receiveCsf.createSession(true, false, false);
+ ClientConsumer consumer = receiveClientSession.createConsumer(recQueue);
+
+
+ ServerLocator sendLocator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ ClientSessionFactory sendCsf = sendLocator.createSessionFactory();
+ ClientSession sendClientSession = sendCsf.createSession(true, false, false);
+ ClientProducer producer = sendClientSession.createProducer(sendQueue);
+
+ receiveClientSession.start(xid, XAResource.TMNOFLAGS);
+ receiveClientSession.start();
+ sendClientSession.start(xid2, XAResource.TMNOFLAGS);
+
+ ClientMessage m = consumer.receive(5000);
+ assertNotNull(m);
+
+ producer.send(m);
+
+
+ receiveClientSession.end(xid, XAResource.TMSUCCESS);
+ sendClientSession.end(xid2, XAResource.TMSUCCESS);
+
+ receiveClientSession.prepare(xid);
+ sendClientSession.prepare(xid2);
+
+ HornetQServerControl serverControl = createManagementControl();
+
+ sendLocator.close();
+ receiveLocator.close();
+
+ boolean success =
serverControl.commitPreparedTransaction(XidImpl.toBase64String(xid));
+
+ success = serverControl.commitPreparedTransaction(XidImpl.toBase64String(xid));
+
+
System.out.println("HornetQServerControlTest.testCommitPreparedTransactions");
+ }
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2011-01-21
18:37:12 UTC (rev 10129)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2011-01-21
18:54:45 UTC (rev 10130)
@@ -325,6 +325,16 @@
return
(Boolean)proxy.retrieveAttributeValue("journalSyncTransactional");
}
+ public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
throws Exception
+ {
+ proxy.invokeOperation("setFailoverOnServerShutdown",
failoverOnServerShutdown);
+ }
+
+ public boolean isFailoverOnServerShutdown()
+ {
+ return
(Boolean)proxy.retrieveAttributeValue("failoverOnServerShutdown");
+ }
+
public boolean isMessageCounterEnabled()
{
return
(Boolean)proxy.retrieveAttributeValue("messageCounterEnabled");