JBoss hornetq SVN: r12042 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:00:29 -0500 (Mon, 23 Jan 2012)
New Revision: 12042
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
Log:
Check mkdirs return value (fixing findbugs warning)
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java 2012-01-23 12:00:14 UTC (rev 12041)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java 2012-01-23 12:00:29 UTC (rev 12042)
@@ -28,15 +28,22 @@
import org.hornetq.utils.Base64;
/**
- * Use this class to import the journal data from a listed file. You can use it as a main class or through its native method {@link ImportJournal#importJournal(String, String, String, int, int, String)}
- *
- * If you use the main method, use it as <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
- *
- * Example: java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * Use this class to import the journal data from a listed file. You can use it as a main class or
+ * through its native method
+ * {@link ImportJournal#importJournal(String, String, String, int, int, String)}
+ * <p>
+ * If you use the main method, use its arguments as:
*
+ * <pre>
+ * JournalDirectory JournalPrefix FileExtension MinFiles FileSize FileOutput
+ * </pre>
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * </pre>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class ImportJournal
{
@@ -103,7 +110,11 @@
File journalDir = new File(directory);
- journalDir.mkdirs();
+ if (!journalDir.exists())
+ {
+ if (!journalDir.mkdirs())
+ System.err.println("Could not create directory " + directory);
+ }
NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
12 years, 5 months
JBoss hornetq SVN: r12041 - in trunk/hornetq-core/src/main/java/org/hornetq/core: persistence/impl/journal and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:00:14 -0500 (Mon, 23 Jan 2012)
New Revision: 12041
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCacheImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
Log:
reduce visibility of classes and method
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCacheImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCacheImpl.java 2012-01-23 11:51:17 UTC (rev 12040)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCacheImpl.java 2012-01-23 12:00:14 UTC (rev 12041)
@@ -27,7 +27,7 @@
*
*
*/
-public class PageCacheImpl implements PageCache
+class PageCacheImpl implements PageCache
{
// Constants -----------------------------------------------------
@@ -81,7 +81,7 @@
lock.readLock().unlock();
}
}
-
+
public long getPageId()
{
return page.getPageId();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2012-01-23 11:51:17 UTC (rev 12040)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2012-01-23 12:00:14 UTC (rev 12041)
@@ -300,7 +300,7 @@
tx.commit();
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -496,9 +496,7 @@
getPageInfo(position).incrementPendingTX();
}
- /* (non-Javadoc)
- * @see org.hornetq.core.paging.cursor.PageCursor#returnElement(org.hornetq.core.paging.cursor.PagePosition)
- */
+ @Override
public void redeliver(final PagePosition position)
{
synchronized (redeliveries)
@@ -647,14 +645,14 @@
Collections.sort(recoveredACK);
boolean first = true;
-
+
long txDeleteCursorOnReload = -1;
for (PagePosition pos : recoveredACK)
{
lastAckedPosition = pos;
PageCursorInfo pageInfo = getPageInfo(pos);
-
+
if (pageInfo == null)
{
log.warn("Couldn't find page cache for page " + pos + ", removing it from the journal");
@@ -674,11 +672,11 @@
pageInfo.confirmed.addAndGet(pos.getMessageNr());
}
}
-
+
pageInfo.addACK(pos);
}
}
-
+
if (txDeleteCursorOnReload >= 0)
{
store.commit(txDeleteCursorOnReload);
@@ -1104,9 +1102,7 @@
}
}
- /* (non-Javadoc)
- * @see java.util.Iterator#next()
- */
+ @Override
public synchronized PagedReference next()
{
@@ -1132,10 +1128,7 @@
}
}
- /* (non-Javadoc)
- * @see org.hornetq.core.paging.cursor.PageCursor#moveNext()
- */
- public PagedReference moveNext() throws Exception
+ private PagedReference moveNext() throws Exception
{
synchronized (PageSubscriptionImpl.this)
{
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2012-01-23 11:51:17 UTC (rev 12040)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2012-01-23 12:00:14 UTC (rev 12041)
@@ -457,7 +457,7 @@
// Inner classes -------------------------------------------------
- class DecodingContext implements BodyEncoder
+ private class DecodingContext implements BodyEncoder
{
private SequentialFile cFile;
12 years, 5 months
JBoss hornetq SVN: r12040 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-23 06:51:17 -0500 (Mon, 23 Jan 2012)
New Revision: 12040
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
Log:
HORNETQ-821 - D'oh
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-23 08:59:32 UTC (rev 12039)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-23 11:51:17 UTC (rev 12040)
@@ -351,8 +351,7 @@
if(failingOver)
{
- failingOver = false;
- failoverCondition.signalAll();
+ unlock();
}
closed = true;
}
12 years, 5 months
JBoss hornetq SVN: r12039 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/discovery.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-23 03:59:32 -0500 (Mon, 23 Jan 2012)
New Revision: 12039
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
Log:
added system property ti disable certain network interfaces from DiscoveryTest
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2012-01-22 08:38:10 UTC (rev 12038)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2012-01-23 08:59:32 UTC (rev 12039)
@@ -124,12 +124,16 @@
InetAddress localAddress = null;
+ String ignoreInterfaces = System.getProperty("ignoreInterfaces", "");
+
+
outer: while (networkInterfaces.hasMoreElements())
{
NetworkInterface networkInterface = networkInterfaces.nextElement();
if (networkInterface.isLoopback() || networkInterface.isVirtual() ||
!networkInterface.isUp() ||
- !networkInterface.supportsMulticast())
+ !networkInterface.supportsMulticast() ||
+ ignoreInterfaces.contains(networkInterface.getDisplayName()) )
{
continue;
}
12 years, 5 months
JBoss hornetq SVN: r12038 - in branches/Branch_2_2_AS7/src/main/org/hornetq: ra and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-22 03:38:10 -0500 (Sun, 22 Jan 2012)
New Revision: 12038
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
Log:
https://issues.jboss.org/browse/HORNETQ-828 - fix method call and clean resources properly
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-21 10:16:47 UTC (rev 12037)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-22 08:38:10 UTC (rev 12038)
@@ -352,7 +352,7 @@
if(failingOver)
{
failingOver = false;
- failoverCondition.notifyAll();
+ failoverCondition.signalAll();
}
closed = true;
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2012-01-21 10:16:47 UTC (rev 12037)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2012-01-22 08:38:10 UTC (rev 12038)
@@ -823,11 +823,13 @@
if(connectionFactory != null)
{
connectionFactory.close();
+ connectionFactory = null;
}
if(recoveryConnectionFactory != null)
{
recoveryConnectionFactory.close();
+ recoveryConnectionFactory = null;
}
}
}
12 years, 5 months
JBoss hornetq SVN: r12037 - in branches/Branch_2_2_AS7/src/main/org/hornetq: ra and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-21 05:16:47 -0500 (Sat, 21 Jan 2012)
New Revision: 12037
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
Log:
https://issues.jboss.org/browse/HORNETQ-828
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-19 11:41:39 UTC (rev 12036)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2012-01-21 10:16:47 UTC (rev 12037)
@@ -349,6 +349,11 @@
throw new IllegalArgumentException("Cannot find channel with id " + id + " to close");
}
+ if(failingOver)
+ {
+ failingOver = false;
+ failoverCondition.notifyAll();
+ }
closed = true;
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2012-01-19 11:41:39 UTC (rev 12036)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQRAManagedConnectionFactory.java 2012-01-21 10:16:47 UTC (rev 12037)
@@ -77,6 +77,12 @@
*/
private HornetQConnectionFactory connectionFactory;
+
+ /**
+ * Connection Factory used if properties are set
+ */
+ private HornetQConnectionFactory recoveryConnectionFactory;
+
/*
* The resource recovery if there is one
* */
@@ -141,7 +147,8 @@
if (connectionFactory == null)
{
connectionFactory = ra.createHornetQConnectionFactory(mcfProperties);
- resourceRecovery = ra.getRecoveryManager().register(connectionFactory, null, null);
+ recoveryConnectionFactory = ra.createRecoveryHornetQConnectionFactory(mcfProperties);
+ resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null);
}
return cf;
}
@@ -758,7 +765,9 @@
if (connectionFactory == null)
{
connectionFactory = ra.createHornetQConnectionFactory(mcfProperties);
- resourceRecovery = ra.getRecoveryManager().register(connectionFactory, null, null);
+ recoveryConnectionFactory = ra.createRecoveryHornetQConnectionFactory(mcfProperties);
+ resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null);
+ resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null);
}
return connectionFactory;
}
@@ -810,5 +819,15 @@
{
ra.getRecoveryManager().unRegister(resourceRecovery);
}
+
+ if(connectionFactory != null)
+ {
+ connectionFactory.close();
+ }
+
+ if(recoveryConnectionFactory != null)
+ {
+ recoveryConnectionFactory.close();
+ }
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-19 11:41:39 UTC (rev 12036)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-21 10:16:47 UTC (rev 12037)
@@ -106,6 +106,8 @@
private final Map<ActivationSpec, HornetQActivation> activations;
private HornetQConnectionFactory defaultHornetQConnectionFactory;
+
+ private HornetQConnectionFactory recoveryHornetQConnectionFactory;
private TransactionManager tm;
@@ -241,10 +243,10 @@
*/
public void stop()
{
- if (HornetQResourceAdapter.trace)
- {
- HornetQResourceAdapter.log.trace("stop()");
- }
+ //if (HornetQResourceAdapter.trace)
+ // {
+ HornetQResourceAdapter.log.info("stop()*******************************************************************");
+ // }
for (Map.Entry<ActivationSpec, HornetQActivation> entry : activations.entrySet())
{
@@ -263,8 +265,11 @@
if (defaultHornetQConnectionFactory != null)
{
defaultHornetQConnectionFactory.close();
+ }
- XARecoveryConfig xaRecoveryConfig = new XARecoveryConfig(defaultHornetQConnectionFactory, raProperties.getUserName(), raProperties.getPassword());
+ if(recoveryHornetQConnectionFactory != null)
+ {
+ recoveryHornetQConnectionFactory.close();
}
recoveryManager.stop();
@@ -1371,7 +1376,8 @@
protected void setup() throws HornetQException
{
defaultHornetQConnectionFactory = createHornetQConnectionFactory(raProperties);
- recoveryManager.register(defaultHornetQConnectionFactory, raProperties.getUserName(), raProperties.getPassword());
+ recoveryHornetQConnectionFactory = createRecoveryHornetQConnectionFactory(raProperties);
+ recoveryManager.register(recoveryHornetQConnectionFactory, raProperties.getUserName(), raProperties.getPassword());
}
public Map<ActivationSpec, HornetQActivation> getActivations()
@@ -1545,6 +1551,106 @@
return cf;
}
+ public HornetQConnectionFactory createRecoveryHornetQConnectionFactory(final ConnectionFactoryProperties overrideProperties)
+ {
+ HornetQConnectionFactory cf;
+ List<String> connectorClassName = overrideProperties.getParsedConnectorClassNames() != null ? overrideProperties.getParsedConnectorClassNames()
+ : raProperties.getParsedConnectorClassNames();
+
+ String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress()
+ : getDiscoveryAddress();
+
+ if (discoveryAddress != null)
+ {
+ Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
+ : getDiscoveryPort();
+
+ if(discoveryPort == null)
+ {
+ discoveryPort = HornetQClient.DEFAULT_DISCOVERY_PORT;
+ }
+
+ DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration(discoveryAddress, discoveryPort);
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("Creating Recovery Connection Factory on the resource adapter for discovery=" + groupConfiguration);
+ }
+
+ Long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
+ : raProperties.getDiscoveryRefreshTimeout();
+ if (refreshTimeout == null)
+ {
+ refreshTimeout = HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
+ }
+
+ Long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
+ : raProperties.getDiscoveryInitialWaitTimeout();
+
+ if(initialTimeout == null)
+ {
+ initialTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
+ }
+
+ groupConfiguration.setDiscoveryInitialWaitTimeout(initialTimeout);
+
+ groupConfiguration.setRefreshTimeout(refreshTimeout);
+
+ cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
+ }
+ else
+ if (connectorClassName != null)
+ {
+ TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
+
+ List<Map<String, Object>> connectionParams;
+ if(overrideProperties.getParsedConnectorClassNames() != null)
+ {
+ connectionParams = overrideProperties.getParsedConnectionParameters();
+ }
+ else
+ {
+ connectionParams = raProperties.getParsedConnectionParameters();
+ }
+
+ for (int i = 0; i < connectorClassName.size(); i++)
+ {
+ TransportConfiguration tc;
+ if(connectionParams == null || i >= connectionParams.size())
+ {
+ tc = new TransportConfiguration(connectorClassName.get(i));
+ log.debug("No connector params provided using default");
+ }
+ else
+ {
+ tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
+ }
+
+ transportConfigurations[i] = tc;
+ }
+
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("Creating Recovery Connection Factory on the resource adapter for transport=" + transportConfigurations);
+ }
+
+ cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, transportConfigurations);
+
+ }
+ else
+ {
+ throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for HornetQ ResourceAdapter Connection Factory");
+ }
+ setParams(cf, overrideProperties);
+
+ //now make sure we are HA in any way
+
+ cf.setReconnectAttempts(0);
+ cf.setInitialConnectAttempts(0);
+ return cf;
+ }
+
public Map<String, Object> overrideConnectionParameters(final Map<String, Object> connectionParams,
final Map<String, Object> overrideConnectionParams)
{
12 years, 5 months
JBoss hornetq SVN: r12036 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-19 06:41:39 -0500 (Thu, 19 Jan 2012)
New Revision: 12036
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
Log:
test for https://issues.jboss.org/browse/HORNETQ-828
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2012-01-17 23:33:31 UTC (rev 12035)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2012-01-19 11:41:39 UTC (rev 12036)
@@ -41,6 +41,8 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
+import org.hornetq.core.client.impl.ClientSessionImpl;
+import org.hornetq.core.client.impl.DelegatingSession;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.transaction.impl.XidImpl;
import org.hornetq.jms.client.HornetQTextMessage;
@@ -130,6 +132,73 @@
return sf.createSession(xa, autoCommitSends, autoCommitAcks);
}
+ //https://issues.jboss.org/browse/HORNETQ-828
+ public void _testSessionClosedOnFailover() throws Exception
+ {
+ this.backupServer.stop();
+ locator.setBlockOnNonDurableSend(true);
+ locator.setBlockOnDurableSend(true);
+ locator.setAckBatchSize(0);
+ locator.setReconnectAttempts(-1);
+
+ final ClientSessionFactoryInternal sf = (ClientSessionFactoryInternal)locator.createSessionFactory();
+
+ final ClientSession session = createSession(sf, true, true);
+
+ try
+ {
+ final ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
+
+ final CountDownLatch latch = new CountDownLatch(1);
+ sf.addFailureListener(new SessionFailureListener()
+ {
+ public void beforeReconnect(HornetQException exception)
+ {
+ latch.countDown();
+ }
+
+ public void connectionFailed(HornetQException exception, boolean failedOver)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+ });
+ crash(false, session);
+
+ latch.await(5000, TimeUnit.MILLISECONDS);
+
+ final CountDownLatch unblocked = new CountDownLatch(1);
+
+ Thread t = new Thread(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ producer.send(session.createMessage(true));
+ System.out.println("FailoverTest.run");
+ unblocked.countDown();
+ }
+ catch (HornetQException e)
+ {
+ //
+ }
+ }
+ });
+
+ t.start();
+
+ Thread.sleep(1000);
+
+ sf.close();
+
+ assertTrue(unblocked.await(10000, TimeUnit.MILLISECONDS));
+ }
+ finally
+ {
+ ((DelegatingSession)session).getChannel().unlock();
+ }
+ }
+
// https://issues.jboss.org/browse/HORNETQ-685
public void testTimeoutOnFailover() throws Exception
{
12 years, 5 months
JBoss hornetq SVN: r12035 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-01-17 18:33:31 -0500 (Tue, 17 Jan 2012)
New Revision: 12035
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
Log:
fixing typo
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2012-01-17 23:27:09 UTC (rev 12034)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2012-01-17 23:33:31 UTC (rev 12035)
@@ -23,7 +23,6 @@
import org.hornetq.core.asyncio.BufferCallback;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.IOCriticalErrorListener;
import org.hornetq.core.journal.SequentialFile;
@@ -345,7 +344,7 @@
{
public ClassLoader run()
{
- return ClientSessionFactoryImpl.class.getClassLoader();
+ return AIOSequentialFileFactory.class.getClassLoader();
}
});
12 years, 5 months
JBoss hornetq SVN: r12034 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-01-17 18:27:09 -0500 (Tue, 17 Jan 2012)
New Revision: 12034
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
Log:
fixing typo
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2012-01-17 14:42:43 UTC (rev 12033)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2012-01-17 23:27:09 UTC (rev 12034)
@@ -25,7 +25,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.journal.IOCriticalErrorListener;
import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.journal.SequentialFileFactory;
@@ -220,7 +219,7 @@
{
public ClassLoader run()
{
- return ClientSessionFactoryImpl.class.getClassLoader();
+ return AbstractSequentialFileFactory.class.getClassLoader();
}
});
12 years, 5 months
JBoss hornetq SVN: r12033 - branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en.
by do-not-reply@jboss.org
Author: jbertram
Date: 2012-01-17 09:42:43 -0500 (Tue, 17 Jan 2012)
New Revision: 12033
Modified:
branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml
Log:
HORNETQ-823
Modified: branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml
===================================================================
--- branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml 2012-01-17 14:40:25 UTC (rev 12032)
+++ branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml 2012-01-17 14:42:43 UTC (rev 12033)
@@ -30,7 +30,8 @@
here's a simple example of posting an order to an order processing queue
express as an HTTP message:</para>
- <para><programlisting>POST /queue/orders/create HTTP/1.1
+ <para><programlisting>
+POST /queue/orders/create HTTP/1.1
Host: example.com
Content-Type: application/xml
@@ -38,8 +39,7 @@
<name>Bill</name>
<item>iPhone 4</item>
<cost>$199.99</cost>
-</order>
-</programlisting>As you can see, we're just posting some arbitrary XML
+</order></programlisting>As you can see, we're just posting some arbitrary XML
document to a URL. When the XML is received on the server is it processed
within HornetQ as a JMS message and distributed through core HornetQ.
Simple and easy. Consuming messages from a queue or topic looks very
@@ -101,19 +101,21 @@
depends on the <ulink url="http://jboss.org/resteasy">RESTEasy</ulink>
project and can currently only run within a servlet container. Installing
the HornetQ REST interface is a little bit different depending whether
- HornetQ is already installed and configured for your environment (i.e.
- you're deploying within JBoss 6 AppServer) or you want the HornetQ REST
- WAR to startup and manage the HornetQ server.</para>
+ HornetQ is already installed and configured for your environment (e.g.
+ you're deploying within JBoss AS 7) or you want the HornetQ REST
+ WAR to startup and manage the HornetQ server (e.g. you're deploying
+ within Tomcat).</para>
<sect1>
<title>Installing Within Pre-configured Environment</title>
<para>The section should be used when you want to use the HornetQ REST
interface in an environment that already has HornetQ installed and
- running, i.e. JBoss 6 Application Server. You must create a Web archive
+ running, e.g. JBoss AS 7. You must create a Web archive
(.WAR) file with the following web.xml settings:</para>
- <programlisting><web-app>
+ <programlisting>
+<web-app>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
@@ -133,22 +135,27 @@
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
+</web-app></programlisting>
-</web-app</programlisting>
-
<para>Within your WEB-INF/lib directory you must have the
hornetq-rest.jar file. If RESTEasy is not installed within your
environment, you must add the RESTEasy jar files within the lib
- directory as well. Here's a sample Maven pom.xml that can build your WAR
- for this case.</para>
+ directory as well (note: RESTEasy is available in most JBoss AS
+ 7 profiles). Here's a sample Maven pom.xml that can build your
+ WAR for this case. If you are unfamiliar with the Maven WAR
+ plugin please reference the <ulink
+ url="http://maven.apache.org/plugins/maven-war-plugin/usage.html">
+ Maven documentation</ulink>.</para>
- <programlisting><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <programlisting>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>myapp</artifactId>
<packaging>war</packaging>
<name>My App</name>
+ <version>0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>jboss</id>
@@ -156,8 +163,8 @@
</repository>
</repositories>
-
- <build>
+ <build>
+ <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -175,10 +182,26 @@
<version>2.2.6.Final</version>
</dependency>
</dependencies>
-</project>
-</programlisting>
+</project></programlisting>
- <para></para>
+ <note><para>JBoss AS 7 loads classes differently than previous versions.
+ To work properly in AS 7 the the WAR will need this in its MANIFEST.MF:</para>
+ <programlisting>Dependencies: org.hornetq, org.jboss.netty</programlisting>
+ <para>You can add this to the <literal><plugins></literal> section of the
+ pom.xml to create this entry automatically:</para><programlisting>
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Dependencies>org.hornetq, org.jboss.netty</Dependencies>
+ </manifestEntries>
+ </archive>
+ </configuration>
+</plugin></programlisting>
+ </note>
+
</sect1>
<sect1>
@@ -192,12 +215,12 @@
REST distribution show how to do this. You must also add an additional
listener to your web.xml file. Here's an example:</para>
- <programlisting><web-app>
+ <programlisting>
+<web-app>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
-
<listener>
<listener-class>org.hornetq.rest.integration.HornetqBootstrapListener</listener-class>
</listener>
@@ -217,7 +240,6 @@
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-
</web-app></programlisting>
<para>Here's a Maven pom.xml file for creating a WAR for this
@@ -225,13 +247,15 @@
src/main/resources directory so that they are stuffed within the WAR's
WEB-INF/classes directory!</para>
- <programlisting><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <programlisting>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>myapp</artifactId>
<packaging>war</packaging>
<name>My App</name>
+ <version>0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>jboss</id>
@@ -239,6 +263,7 @@
</repository>
</repositories>
<build>
+ <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -253,16 +278,17 @@
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core</artifactId>
- <version>2.1.1.GA</version>
+ <version>2.2.9.AS7.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
+ <version>3.2.7.Final</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms</artifactId>
- <version>2.1.1.GA</version>
+ <version>2.2.9.AS7.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
@@ -277,12 +303,12 @@
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
- <version>2.0.1.GA</version>
+ <version>2.3.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
- <version>2.0.1.GA</version>
+ <version>2.3.0.GA</version>
</dependency>
</dependencies>
</project></programlisting>
@@ -300,7 +326,8 @@
configuration file. Below is the format of the XML configuration file
and the default values for each.</para>
- <programlisting><rest-messaging>
+ <programlisting>
+<rest-messaging>
<server-in-vm-id>0</server-in-vm-id>
<use-link-headers>false</use-link-headers>
<default-durable-send>false</default-durable-send>
@@ -311,8 +338,7 @@
<session-timeout-task-interval>1</session-timeout-task-interval>
<consumer-session-timeout-seconds>300</consumer-session-timeout-seconds>
<consumer-window-size>-1</consumer-window-size>
-</rest-messaging
-</programlisting>
+</rest-messaging</programlisting>
<para>Let's give an explanation of each config option.</para>
@@ -435,9 +461,9 @@
<para>To interact with a queue or topic you do a HEAD or GET request on
the following relative URI pattern:</para>
- <programlisting>/queues/{name}
-/topics/{name}
-</programlisting>
+ <programlisting>
+/queues/{name}
+/topics/{name}</programlisting>
<para>The base of the URI is the base URL of the WAR you deployed the
HornetQ REST server within as defined in the Installation and
@@ -453,15 +479,15 @@
perform your HEAD or GET request on this URI. Here's what a
request/response would look like.</para>
- <programlisting>HEAD /queues/jms.queue.bar HTTP/1.1
+ <programlisting>
+HEAD /queues/jms.queue.bar HTTP/1.1
Host: example.com
--- Response ---
HTTP/1.1 200 Ok
msg-create: http://example.com/queues/jms.queue.bar/create
msg-pull-consumers: http://example.com/queues/jms.queue.bar/pull-consumers
-msg-push-consumers: http://example.com/queues/jms.queue.bar/push-consumers
-</programlisting>
+msg-push-consumers: http://example.com/queues/jms.queue.bar/push-consumers</programlisting>
<para>The HEAD or GET response contains a number of custom response
headers that are URLs to additional REST resources that allow you to
@@ -644,7 +670,7 @@
</listitem>
</orderedlist>
- <para>It is <emphasis>VERY IMPORTENT</emphasis> that you never re-use
+ <para>It is <emphasis>VERY IMPORTANT</emphasis> that you never re-use
returned <literal>msg-create-next</literal> headers to post new messages.
This URL may be uniquely generated for each message and used for duplicate
detection. If you lose the URL within the
12 years, 5 months