[jboss-cvs] JBoss Messaging SVN: r5494 - in trunk: src/main/org/jboss/messaging/core/persistence/impl/journal and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 9 16:39:38 EST 2008
Author: timfox
Date: 2008-12-09 16:39:37 -0500 (Tue, 09 Dec 2008)
New Revision: 5494
Modified:
trunk/examples/messaging/src/org/jboss/messaging/example/SimpleExample.java
trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java
trunk/src/main/org/jboss/messaging/core/postoffice/impl/DuplicateIDCacheImpl.java
trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServiceImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java
trunk/src/main/org/jboss/messaging/core/transaction/Transaction.java
trunk/src/main/org/jboss/messaging/core/transaction/impl/TransactionImpl.java
trunk/tests/src/org/jboss/messaging/tests/integration/DuplicateDetectionTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/basic/AutoGroupClientTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/basic/ClientRequestorTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/basic/CoreClientTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientExitTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/distribution/MessageFlowTestBase.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/AutomaticFailoverWithDiscoveryTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverExpiredMessageTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverManagementTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverNoSessionsFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverPreAcknowledgeTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverScheduledMessageTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureListenerOnFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureOnCreateConnectionTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/MultiThreadRandomFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/RandomFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectWithBackupTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleAutomaticFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleManualFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/http/CoreClientOverHttpTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/consumer/ConsumerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/NotificationTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/queue/DeadLetterAddressTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryAddressTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryRunnerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/queue/MessageGroupingTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/wildcard/WildCardRoutingTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/xa/XaTimeoutTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/MessagingServiceImplTest.java
trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
Log:
Duplicate detection part 3
Modified: trunk/examples/messaging/src/org/jboss/messaging/example/SimpleExample.java
===================================================================
--- trunk/examples/messaging/src/org/jboss/messaging/example/SimpleExample.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/examples/messaging/src/org/jboss/messaging/example/SimpleExample.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -52,7 +52,7 @@
ConfigurationImpl configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
configuration.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory"));
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
//start the server
messagingService.start();
Modified: trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -382,7 +382,7 @@
}
public void commit(final long txID) throws Exception
- {
+ {
messageJournal.appendCommitRecord(txID);
}
@@ -589,9 +589,13 @@
if (ids == null)
{
ids = new ArrayList<Pair<SimpleString, Long>>();
+
+ duplicateIDMap.put(encoding.address, ids);
}
ids.add(new Pair<SimpleString, Long>(encoding.duplID, record.id));
+
+ break;
}
default:
{
@@ -951,6 +955,8 @@
if (ids == null)
{
ids = new ArrayList<Pair<SimpleString, Long>>();
+
+ duplicateIDMap.put(encoding.address, ids);
}
ids.add(new Pair<SimpleString, Long>(encoding.duplID, record.id));
Modified: trunk/src/main/org/jboss/messaging/core/postoffice/impl/DuplicateIDCacheImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/postoffice/impl/DuplicateIDCacheImpl.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/postoffice/impl/DuplicateIDCacheImpl.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -124,13 +124,13 @@
int count = 0;
long txID = -1;
-
- for (Pair<SimpleString, Long> id : ids)
+
+ for (Pair<SimpleString, Long> id : theIds)
{
if (count < cacheSize)
{
cache.add(id.a);
-
+
ids.add(id);
}
else
@@ -178,7 +178,7 @@
if (persist)
{
- storageManager.storeDuplicateIDTransactional(tx.getID(), address, duplID, recordID);
+ tx.addDuplicateID(address, duplID, recordID);
}
// For a tx, it's important that the entry is not added to the cache until commit (or prepare)
Modified: trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -542,7 +542,7 @@
SimpleString address = entry.getKey();
DuplicateIDCache cache = getDuplicateIDCache(address);
-
+
if (persistIDCache)
{
cache.load(entry.getValue());
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServiceImpl.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServiceImpl.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -49,55 +49,41 @@
*/
public class MessagingServiceImpl implements MessagingService
{
- public static MessagingServiceImpl newNullStorageMessagingServer()
+ public static MessagingServiceImpl newNullStorageMessagingService()
{
- return newNullStorageMessagingServer(new ConfigurationImpl());
+ return newNullStorageMessagingService(new ConfigurationImpl());
}
-
- public static MessagingServiceImpl newNullStorageMessagingServer(final Configuration config)
+
+ public static MessagingServiceImpl newNullStorageMessagingService(final Configuration config)
{
StorageManager storageManager = new NullStorageManager();
-
+
RemotingService remotingService = new RemotingServiceImpl(config);
JBMSecurityManager securityManager = new JBMSecurityManagerImpl(true);
-
- ManagementService managementService = new ManagementServiceImpl(ManagementFactory.getPlatformMBeanServer(), config.isJMXManagementEnabled());
-
+
+ ManagementService managementService = new ManagementServiceImpl(ManagementFactory.getPlatformMBeanServer(),
+ config.isJMXManagementEnabled());
+
MessagingServer server = new MessagingServerImpl();
-
+
server.setConfiguration(config);
-
+
server.setStorageManager(storageManager);
-
+
server.setRemotingService(remotingService);
-
+
server.setSecurityManager(securityManager);
-
+
server.setManagementService(managementService);
-
+
return new MessagingServiceImpl(server, storageManager, remotingService);
}
- public static MessagingServiceImpl newNioStorageMessagingServer(final Configuration config, String journalDir, String bindingsDir, String largeMessagesDir)
- {
- NIOSequentialFileFactory sequentialFileFactory = new NIOSequentialFileFactory(journalDir);
- NIOSequentialFileFactory sequentialFileFactory2 = new NIOSequentialFileFactory(bindingsDir);
- Journal msgs =
- new JournalImpl(config.getJournalFileSize(),
- config.getJournalMinFiles(), config.isJournalSyncTransactional(),
- config.isJournalSyncNonTransactional(), sequentialFileFactory2,
- "jbm-data", "jbm", config.getJournalMaxAIO(), 0);
- Journal bindings =
- new JournalImpl(config.getJournalFileSize(),
- config.getJournalMinFiles(), config.isJournalSyncTransactional(),
- config.isJournalSyncNonTransactional(), sequentialFileFactory,
- "jbm-bindings", "jbm", config.getJournalMaxAIO(), 0);
-
- SequentialFileFactory largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDir);
+ public static MessagingServiceImpl newMessagingService(final Configuration config)
+ {
+ StorageManager storageManager = new JournalStorageManager(config);
- StorageManager storageManager = new JournalStorageManager(msgs, bindings, largeMessagesFactory);
-
RemotingService remotingService = new RemotingServiceImpl(config);
JBMSecurityManager securityManager = new JBMSecurityManagerImpl(true);
@@ -118,40 +104,41 @@
return new MessagingServiceImpl(server, storageManager, remotingService);
}
-
+
private final MessagingServer server;
-
+
private final StorageManager storageManager;
-
+
private final RemotingService remotingService;
-
- public MessagingServiceImpl(final MessagingServer server, final StorageManager storageManager,
- final RemotingService remotingService)
+
+ public MessagingServiceImpl(final MessagingServer server,
+ final StorageManager storageManager,
+ final RemotingService remotingService)
{
this.server = server;
this.storageManager = storageManager;
this.remotingService = remotingService;
}
-
+
public void start() throws Exception
{
storageManager.start();
- remotingService.start();
+ remotingService.start();
server.start();
}
-
+
public void stop() throws Exception
{
remotingService.stop();
server.stop();
storageManager.stop();
}
-
+
public MessagingServer getServer()
{
return server;
}
-
+
public boolean isStarted()
{
return server.isStarted();
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -541,6 +541,7 @@
public void handleCreateQueue(final SessionCreateQueueMessage packet)
{
final SendLock lock;
+
if (channel.getReplicatingChannel() != null)
{
lock = postOffice.getAddressLock(packet.getAddress());
@@ -2250,7 +2251,6 @@
public void handleSendContinuations(final SessionSendContinuationMessage packet)
{
-
DelayedResult result = channel.replicatePacket(packet);
// With a send we must make sure it is replicated to backup before being processed on live
@@ -2270,10 +2270,7 @@
}
});
}
-
-
}
-
public void handleReplicatedDelivery(final SessionReplicateDeliveryMessage packet)
{
Modified: trunk/src/main/org/jboss/messaging/core/transaction/Transaction.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/transaction/Transaction.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/transaction/Transaction.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -32,6 +32,7 @@
import org.jboss.messaging.core.server.ServerMessage;
import org.jboss.messaging.core.settings.HierarchicalRepository;
import org.jboss.messaging.core.settings.impl.QueueSettings;
+import org.jboss.messaging.util.SimpleString;
/**
* A JBoss Messaging internal transaction
@@ -47,6 +48,8 @@
List<MessageReference> rollback(HierarchicalRepository<QueueSettings> queueSettingsRepository) throws Exception;
+ void addDuplicateID(SimpleString address, SimpleString duplID, long recordID) throws Exception;
+
void addMessage(ServerMessage message) throws Exception;
void addAcknowledgement(MessageReference acknowledgement) throws Exception;
@@ -76,9 +79,9 @@
List<MessageReference> timeout() throws Exception;
long getCreateTime();
-
+
void addSynchronization(TransactionSynchronization sync);
-
+
void removeSynchronization(TransactionSynchronization sync);
static enum State
Modified: trunk/src/main/org/jboss/messaging/core/transaction/impl/TransactionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/transaction/impl/TransactionImpl.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/src/main/org/jboss/messaging/core/transaction/impl/TransactionImpl.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -150,6 +150,14 @@
{
return id;
}
+
+ public void addDuplicateID(final SimpleString address, final SimpleString duplID,
+ final long recordID) throws Exception
+ {
+ storageManager.storeDuplicateIDTransactional(id, address, duplID, recordID);
+
+ containsPersistent = true;
+ }
public void addMessage(final ServerMessage message) throws Exception
{
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/DuplicateDetectionTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/DuplicateDetectionTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/DuplicateDetectionTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -20,7 +20,6 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
package org.jboss.messaging.tests.integration;
import org.jboss.messaging.core.client.ClientConsumer;
@@ -31,13 +30,12 @@
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.message.impl.MessageImpl;
import org.jboss.messaging.core.postoffice.impl.DuplicateIDCacheImpl;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
-import org.jboss.messaging.tests.util.UnitTestCase;
+import org.jboss.messaging.tests.util.ServiceTestBase;
import org.jboss.messaging.util.SimpleString;
/**
@@ -49,125 +47,124 @@
*
*
*/
-public class DuplicateDetectionTest extends UnitTestCase
+public class DuplicateDetectionTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(DuplicateDetectionTest.class);
private MessagingService messagingService;
-
+
private final SimpleString propKey = new SimpleString("propkey");
-
+
private final int cacheSize = 10;
-
+
public void testSimpleDuplicateDetecion() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
ClientSession session = sf.createSession(false, true, true);
-
+
session.start();
-
+
final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
session.createQueue(queueName, queueName, null, false, false, true);
ClientProducer producer = session.createProducer(queueName);
-
+
ClientConsumer consumer = session.createConsumer(queueName);
-
- ClientMessage message = createMessage(session, 0);
- producer.send(message);
+
+ ClientMessage message = createMessage(session, 0);
+ producer.send(message);
ClientMessage message2 = consumer.receive(1000);
assertEquals(0, message2.getProperty(propKey));
-
+
message = createMessage(session, 1);
SimpleString dupID = new SimpleString("abcdefg");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(1000);
assertEquals(1, message2.getProperty(propKey));
-
+
message = createMessage(session, 2);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(250);
assertNull(message2);
-
+
message = createMessage(session, 3);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(250);
assertNull(message2);
-
- //Now try with a different id
-
+
+ // Now try with a different id
+
message = createMessage(session, 4);
SimpleString dupID2 = new SimpleString("hijklmnop");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(1000);
assertEquals(4, message2.getProperty(propKey));
-
- message = createMessage(session, 5);
+
+ message = createMessage(session, 5);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(1000);
assertNull(message2);
-
-
+
message = createMessage(session, 6);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
+ producer.send(message);
message2 = consumer.receive(250);
assertNull(message2);
-
+
session.close();
-
+
sf.close();
}
-
+
public void testCacheSize() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
ClientSession session = sf.createSession(false, true, true);
-
+
session.start();
-
+
final SimpleString queueName1 = new SimpleString("DuplicateDetectionTestQueue1");
-
+
final SimpleString queueName2 = new SimpleString("DuplicateDetectionTestQueue2");
-
+
final SimpleString queueName3 = new SimpleString("DuplicateDetectionTestQueue3");
session.createQueue(queueName1, queueName1, null, false, false, true);
-
+
session.createQueue(queueName2, queueName2, null, false, false, true);
-
+
session.createQueue(queueName3, queueName3, null, false, false, true);
- ClientProducer producer1 = session.createProducer(queueName1);
+ ClientProducer producer1 = session.createProducer(queueName1);
ClientConsumer consumer1 = session.createConsumer(queueName1);
-
- ClientProducer producer2 = session.createProducer(queueName2);
+
+ ClientProducer producer2 = session.createProducer(queueName2);
ClientConsumer consumer2 = session.createConsumer(queueName2);
-
- ClientProducer producer3 = session.createProducer(queueName3);
+
+ ClientProducer producer3 = session.createProducer(queueName3);
ClientConsumer consumer3 = session.createConsumer(queueName3);
-
+
for (int i = 0; i < cacheSize; i++)
{
SimpleString dupID = new SimpleString("dupID" + i);
-
+
ClientMessage message = createMessage(session, i);
-
+
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
-
+
producer1.send(message);
producer2.send(message);
producer3.send(message);
}
-
+
for (int i = 0; i < cacheSize; i++)
{
ClientMessage message = consumer1.receive(1000);
@@ -180,43 +177,43 @@
assertNotNull(message);
assertEquals(i, message.getProperty(propKey));
}
-
+
DuplicateIDCacheImpl.dumpCaches();
-
+
log.info("Now sending more");
for (int i = 0; i < cacheSize; i++)
{
SimpleString dupID = new SimpleString("dupID" + i);
-
+
ClientMessage message = createMessage(session, i);
-
+
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
-
+
producer1.send(message);
producer2.send(message);
producer3.send(message);
}
-
+
ClientMessage message = consumer1.receive(100);
assertNull(message);
message = consumer2.receive(100);
assertNull(message);
message = consumer3.receive(100);
assertNull(message);
-
+
for (int i = 0; i < cacheSize; i++)
{
SimpleString dupID = new SimpleString("dupID2-" + i);
-
+
message = createMessage(session, i);
-
+
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
-
+
producer1.send(message);
producer2.send(message);
producer3.send(message);
}
-
+
for (int i = 0; i < cacheSize; i++)
{
message = consumer1.receive(1000);
@@ -229,42 +226,42 @@
assertNotNull(message);
assertEquals(i, message.getProperty(propKey));
}
-
+
for (int i = 0; i < cacheSize; i++)
{
SimpleString dupID = new SimpleString("dupID2-" + i);
-
+
message = createMessage(session, i);
-
+
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
-
+
producer1.send(message);
producer2.send(message);
producer3.send(message);
}
-
+
message = consumer1.receive(100);
assertNull(message);
message = consumer2.receive(100);
assertNull(message);
message = consumer3.receive(100);
assertNull(message);
-
- //Should be able to send the first lot again now - since the second lot pushed the
- //first lot out of the cache
+
+ // Should be able to send the first lot again now - since the second lot pushed the
+ // first lot out of the cache
for (int i = 0; i < cacheSize; i++)
{
SimpleString dupID = new SimpleString("dupID" + i);
-
+
message = createMessage(session, i);
-
+
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
-
+
producer1.send(message);
producer2.send(message);
producer3.send(message);
}
-
+
for (int i = 0; i < cacheSize; i++)
{
message = consumer1.receive(1000);
@@ -277,187 +274,796 @@
assertNotNull(message);
assertEquals(i, message.getProperty(propKey));
}
-
+
session.close();
-
+
sf.close();
}
-
+
public void testTransactedDuplicateDetection1() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
ClientSession session = sf.createSession(false, false, false);
-
+
session.start();
-
+
final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
session.createQueue(queueName, queueName, null, false, false, true);
ClientProducer producer = session.createProducer(queueName);
-
+
ClientMessage message = createMessage(session, 0);
SimpleString dupID = new SimpleString("abcdefg");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
-
+ producer.send(message);
+
session.close();
-
+
session = sf.createSession(false, false, false);
-
+
session.start();
-
+
producer = session.createProducer(queueName);
-
+
ClientConsumer consumer = session.createConsumer(queueName);
-
- //Should be able to resend it and not get rejected since transaction didn't commit
-
+
+ // Should be able to resend it and not get rejected since transaction didn't commit
+
message = createMessage(session, 1);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
-
- session.commit();
-
+ producer.send(message);
+
+ session.commit();
+
message = consumer.receive(250);
assertEquals(1, message.getProperty(propKey));
-
+
message = consumer.receive(250);
assertNull(message);
-
+
session.close();
-
+
sf.close();
}
-
+
public void testTransactedDuplicateDetection2() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
ClientSession session = sf.createSession(false, false, false);
-
+
session.start();
-
+
final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
session.createQueue(queueName, queueName, null, false, false, true);
ClientProducer producer = session.createProducer(queueName);
-
+
ClientConsumer consumer = session.createConsumer(queueName);
-
+
ClientMessage message = createMessage(session, 0);
SimpleString dupID = new SimpleString("abcdefg");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
-
+ producer.send(message);
+
session.rollback();
-
- //Should be able to resend it and not get rejected since transaction didn't commit
-
+
+ // Should be able to resend it and not get rejected since transaction didn't commit
+
message = createMessage(session, 1);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
- producer.send(message);
-
- session.commit();
-
+ producer.send(message);
+
+ session.commit();
+
message = consumer.receive(250);
assertEquals(1, message.getProperty(propKey));
-
+
message = consumer.receive(250);
assertNull(message);
-
+
session.close();
-
+
sf.close();
}
-
+
public void testTransactedDuplicateDetection3() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
ClientSession session = sf.createSession(false, false, false);
-
+
session.start();
-
+
final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
session.createQueue(queueName, queueName, null, false, false, true);
ClientProducer producer = session.createProducer(queueName);
-
+
ClientConsumer consumer = session.createConsumer(queueName);
-
+
ClientMessage message = createMessage(session, 0);
SimpleString dupID1 = new SimpleString("abcdefg");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID1);
- producer.send(message);
-
+ producer.send(message);
+
message = createMessage(session, 1);
SimpleString dupID2 = new SimpleString("hijklmno");
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
- producer.send(message);
-
+ producer.send(message);
+
session.commit();
-
- //These next two should get rejected
-
- message = createMessage(session, 2);
+
+ // These next two should get rejected
+
+ message = createMessage(session, 2);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID1);
- producer.send(message);
-
- message = createMessage(session, 3);
+ producer.send(message);
+
+ message = createMessage(session, 3);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
- producer.send(message);
-
- session.commit();
-
+ producer.send(message);
+
+ session.commit();
+
message = consumer.receive(250);
assertEquals(0, message.getProperty(propKey));
-
+
message = consumer.receive(250);
assertEquals(1, message.getProperty(propKey));
-
+
message = consumer.receive(250);
assertNull(message);
-
+
session.close();
-
+
sf.close();
}
-
+
private ClientMessage createMessage(final ClientSession session, final int i)
{
ClientMessage message = session.createClientMessage(false);
-
+
message.putIntProperty(propKey, i);
-
+
return message;
}
+
+ public void testDuplicateCachePersisted() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setIDCacheSize(cacheSize);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ ClientMessage message = createMessage(session, 1);
+ SimpleString dupID = new SimpleString("abcdefg");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ SimpleString dupID2 = new SimpleString("hijklmnopqr");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ message2 = consumer.receive(1000);
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, true, true);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ message = createMessage(session, 1);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ message2 = consumer.receive(200);
+ assertNull(message2);
+
+ message = createMessage(session, 2);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ message2 = consumer.receive(200);
+ assertNull(message2);
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+ public void testDuplicateCachePersisted2() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ final int theCacheSize = 5;
+
+ conf.setIDCacheSize(theCacheSize);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < theCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(i, message2.getProperty(propKey));
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, true, true);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < theCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(100);
+ assertNull(message2);
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+ public void testDuplicateCachePersistedRestartWithSmallerCache() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ final int initialCacheSize = 10;
+ final int subsequentCacheSize = 5;
+
+ conf.setIDCacheSize(initialCacheSize);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < initialCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(i, message2.getProperty(propKey));
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ conf.setIDCacheSize(subsequentCacheSize);
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, true, true);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < initialCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ if (i >= subsequentCacheSize)
+ {
+ //Message should get through
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(i, message2.getProperty(propKey));
+ }
+ else
+ {
+ ClientMessage message2 = consumer.receive(100);
+ assertNull(message2);
+ }
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+ public void testDuplicateCachePersistedRestartWithSmallerCacheEnsureDeleted() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ final int initialCacheSize = 10;
+ final int subsequentCacheSize = 5;
+
+ conf.setIDCacheSize(initialCacheSize);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < initialCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(i, message2.getProperty(propKey));
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ conf.setIDCacheSize(subsequentCacheSize);
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ //Now stop and set back to original cache size and restart
+
+ messagingService2.stop();
+
+ conf.setIDCacheSize(initialCacheSize);
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, true, true);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ for (int i = 0; i < initialCacheSize; i++)
+ {
+ ClientMessage message = createMessage(session, i);
+ SimpleString dupID = new SimpleString("abcdefg" + i);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ if (i >= subsequentCacheSize)
+ {
+ //Message should get through
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(i, message2.getProperty(propKey));
+ }
+ else
+ {
+ ClientMessage message2 = consumer.receive(100);
+ assertNull(message2);
+ }
+ }
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+ public void testNoPersist() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setIDCacheSize(cacheSize);
+
+ conf.setPersistIDCache(false);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, true, true);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ ClientMessage message = createMessage(session, 1);
+ SimpleString dupID = new SimpleString("abcdefg");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ SimpleString dupID2 = new SimpleString("hijklmnopqr");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ message2 = consumer.receive(1000);
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, true, true);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ message = createMessage(session, 1);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ message2 = consumer.receive(200);
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ message2 = consumer.receive(200);
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+ public void testNoPersistTransactional() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setIDCacheSize(cacheSize);
+
+ conf.setPersistIDCache(false);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, false, false);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ ClientMessage message = createMessage(session, 1);
+ SimpleString dupID = new SimpleString("abcdefg");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ session.commit();
+ ClientMessage message2 = consumer.receive(1000);
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ SimpleString dupID2 = new SimpleString("hijklmnopqr");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(1000);
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, false, false);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ message = createMessage(session, 1);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(200);
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(200);
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+ public void testPersistTransactional() throws Exception
+ {
+ messagingService.stop();
+
+ Configuration conf = createDefaultConfig();
+
+ conf.setIDCacheSize(cacheSize);
+
+ MessagingService messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ ClientSession session = sf.createSession(false, false, false);
+
+ session.start();
+
+ final SimpleString queueName = new SimpleString("DuplicateDetectionTestQueue");
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ ClientProducer producer = session.createProducer(queueName);
+
+ ClientConsumer consumer = session.createConsumer(queueName);
+
+ ClientMessage message = createMessage(session, 1);
+ SimpleString dupID = new SimpleString("abcdefg");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ session.commit();
+ ClientMessage message2 = consumer.receive(1000);
+ message2.acknowledge();
+ session.commit();
+ assertEquals(1, message2.getProperty(propKey));
+
+ message = createMessage(session, 2);
+ SimpleString dupID2 = new SimpleString("hijklmnopqr");
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(1000);
+ message2.acknowledge();
+ session.commit();
+ assertEquals(2, message2.getProperty(propKey));
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+
+ messagingService2 = MessagingServiceImpl.newMessagingService(conf);
+
+ messagingService2.start();
+
+ sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
+
+ session = sf.createSession(false, false, false);
+
+ session.start();
+
+ session.createQueue(queueName, queueName, null, false, false, true);
+
+ producer = session.createProducer(queueName);
+
+ consumer = session.createConsumer(queueName);
+
+ message = createMessage(session, 1);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(200);
+ assertNull(message2);
+
+ message = createMessage(session, 2);
+ message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
+ producer.send(message);
+ session.commit();
+ message2 = consumer.receive(200);
+ assertNull(message2);
+
+ session.close();
+
+ sf.close();
+
+ messagingService2.stop();
+ }
+
+
@Override
protected void setUp() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ super.setUp();
+
+ clearData();
+
+ Configuration conf = createDefaultConfig();
- conf.setSecurityEnabled(false);
-
conf.setIDCacheSize(cacheSize);
- conf.getAcceptorConfigurations()
- .add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
-
messagingService.start();
}
@Override
protected void tearDown() throws Exception
{
- messagingService.stop();
-
+ if (messagingService.isStarted())
+ {
+ messagingService.stop();
+ }
+
super.tearDown();
}
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/basic/AutoGroupClientTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/basic/AutoGroupClientTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/basic/AutoGroupClientTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -63,7 +63,7 @@
conf.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.getServer().getQueueSettingsRepository().addMatch("testGroupQueue", qs);
messagingService.start();
@@ -124,7 +124,7 @@
conf.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.getServer().getQueueSettingsRepository().addMatch("testGroupQueue", qs);
messagingService.start();
@@ -193,7 +193,7 @@
conf.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.getServer().getQueueSettingsRepository().addMatch("testGroupQueue", qs);
messagingService.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/basic/ClientRequestorTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/basic/ClientRequestorTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/basic/ClientRequestorTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -234,7 +234,7 @@
Configuration conf = new ConfigurationImpl();
conf.setSecurityEnabled(false);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/basic/CoreClientTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/basic/CoreClientTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/basic/CoreClientTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -72,7 +72,7 @@
conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactoryClassName));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientExitTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientExitTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientExitTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -101,7 +101,7 @@
ConfigurationImpl config = new ConfigurationImpl();
config.setSecurityEnabled(false);
config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory"));
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(config);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(config);
messagingService.start();
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyConnectorFactory"));
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/distribution/MessageFlowTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/distribution/MessageFlowTestBase.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/distribution/MessageFlowTestBase.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -54,7 +54,7 @@
serviceConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
params));
- MessagingService service = MessagingServiceImpl.newNullStorageMessagingServer(serviceConf);
+ MessagingService service = MessagingServiceImpl.newNullStorageMessagingService(serviceConf);
return service;
}
@@ -68,7 +68,7 @@
serviceConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
params));
- MessagingService service = MessagingServiceImpl.newNullStorageMessagingServer(serviceConf);
+ MessagingService service = MessagingServiceImpl.newNullStorageMessagingService(serviceConf);
return service;
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -274,7 +274,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -287,7 +287,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/AutomaticFailoverWithDiscoveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/AutomaticFailoverWithDiscoveryTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/AutomaticFailoverWithDiscoveryTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -186,7 +186,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -224,7 +224,7 @@
bcConfigs1.add(bcConfig1);
liveConf.setBroadcastGroupConfigurations(bcConfigs1);
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -189,7 +189,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -202,7 +202,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverExpiredMessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverExpiredMessageTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverExpiredMessageTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -199,7 +199,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -212,7 +212,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverManagementTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverManagementTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverManagementTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -275,7 +275,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -288,7 +288,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverNoSessionsFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverNoSessionsFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverNoSessionsFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -191,7 +191,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -204,7 +204,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverPreAcknowledgeTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverPreAcknowledgeTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverPreAcknowledgeTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -174,7 +174,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -187,7 +187,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverScheduledMessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverScheduledMessageTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverScheduledMessageTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -193,7 +193,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -206,7 +206,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureListenerOnFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureListenerOnFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureListenerOnFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -337,7 +337,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -351,7 +351,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureOnCreateConnectionTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureOnCreateConnectionTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailureOnCreateConnectionTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -95,7 +95,7 @@
liveConf.setSecurityEnabled(false);
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- service = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/MultiThreadRandomFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/MultiThreadRandomFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/MultiThreadRandomFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -1342,7 +1342,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
// We need to sleep > 16 ms otherwise the id generators on live and backup could be initialised
@@ -1360,7 +1360,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/RandomFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/RandomFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/RandomFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -1478,7 +1478,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
// We need to sleep > 16 ms otherwise the id generators on live and backup could be initialised
@@ -1496,7 +1496,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -621,7 +621,7 @@
liveConf.setSecurityEnabled(false);
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- service = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectWithBackupTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectWithBackupTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReconnectWithBackupTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -286,7 +286,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -300,7 +300,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -182,7 +182,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -196,7 +196,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleAutomaticFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleAutomaticFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleAutomaticFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -714,7 +714,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -727,7 +727,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleManualFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleManualFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/SimpleManualFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -185,14 +185,14 @@
server1Conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
server1Params));
- server1Service = MessagingServiceImpl.newNullStorageMessagingServer(server1Conf);
+ server1Service = MessagingServiceImpl.newNullStorageMessagingService(server1Conf);
server1Service.start();
Configuration server0Conf = new ConfigurationImpl();
server0Conf.setSecurityEnabled(false);
server0Conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- server0Service = MessagingServiceImpl.newNullStorageMessagingServer(server0Conf);
+ server0Service = MessagingServiceImpl.newNullStorageMessagingService(server0Conf);
server0Service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -59,7 +59,7 @@
conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/http/CoreClientOverHttpTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/http/CoreClientOverHttpTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/http/CoreClientOverHttpTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -55,7 +55,7 @@
params.put("jbm.remoting.netty.httpenabled", true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.start();
@@ -108,7 +108,7 @@
params.put("jbm.remoting.netty.httpenabled", true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(conf);
messagingService.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -328,7 +328,7 @@
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
backupParams));
backupConf.setBackup(true);
- backupService = MessagingServiceImpl.newNullStorageMessagingServer(backupConf);
+ backupService = MessagingServiceImpl.newNullStorageMessagingService(backupConf);
backupService.start();
Configuration liveConf = new ConfigurationImpl();
@@ -342,7 +342,7 @@
connectors.put(backupTC.getName(), backupTC);
liveConf.setConnectorConfigurations(connectors);
liveConf.setBackupConnectorName(backupTC.getName());
- liveService = MessagingServiceImpl.newNullStorageMessagingServer(liveConf);
+ liveService = MessagingServiceImpl.newNullStorageMessagingService(liveConf);
liveService.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/consumer/ConsumerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/consumer/ConsumerTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/consumer/ConsumerTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -83,7 +83,7 @@
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
serverManager = JMSServerManagerImpl.newJMSServerManagerImpl(service.getServer());
serverManager.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -297,7 +297,7 @@
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
serverManager = JMSServerManagerImpl.newJMSServerManagerImpl(service.getServer());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -97,7 +97,7 @@
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactory));
- MessagingService service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ MessagingService service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
JMSServerManagerImpl serverManager = JMSServerManagerImpl.newJMSServerManagerImpl(service.getServer());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -192,7 +192,7 @@
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
serverManager = JMSServerManagerImpl.newJMSServerManagerImpl(service.getServer());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/NotificationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/NotificationTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/NotificationTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -186,7 +186,7 @@
conf.setJMXManagementEnabled(false);
conf.getAcceptorConfigurations()
.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -374,7 +374,7 @@
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
- service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
+ service = MessagingServiceImpl.newNullStorageMessagingService(conf);
service.start();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/queue/DeadLetterAddressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/queue/DeadLetterAddressTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/queue/DeadLetterAddressTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -241,7 +241,7 @@
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
//start the server
messagingService.start();
//then we create a client as normal
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryAddressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryAddressTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryAddressTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -183,7 +183,7 @@
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
// start the server
messagingService.start();
// then we create a client as normal
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryRunnerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryRunnerTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/queue/ExpiryRunnerTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -294,7 +294,7 @@
configuration.setMessageExpiryScanPeriod(1000);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
// start the server
messagingService.start();
// then we create a client as normal
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/queue/MessageGroupingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/queue/MessageGroupingTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/queue/MessageGroupingTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -550,7 +550,7 @@
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
// start the server
messagingService.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/wildcard/WildCardRoutingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/wildcard/WildCardRoutingTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/wildcard/WildCardRoutingTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -635,7 +635,7 @@
configuration.setTransactionTimeoutScanPeriod(500);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
//start the server
messagingService.start();
//then we create a client as normal
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/xa/XaTimeoutTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/xa/XaTimeoutTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/xa/XaTimeoutTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -75,7 +75,7 @@
configuration.setTransactionTimeoutScanPeriod(500);
TransportConfiguration transportConfig = new TransportConfiguration(INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
- messagingService = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ messagingService = MessagingServiceImpl.newNullStorageMessagingService(configuration);
//start the server
messagingService.start();
//then we create a client as normal
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/MessagingServiceImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/MessagingServiceImplTest.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/MessagingServiceImplTest.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -73,7 +73,7 @@
public void testNewNullStorageMessagingServer() throws Exception
{
Configuration config = new ConfigurationImpl();
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer(config);
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService(config);
messagingService.start();
assertTrue(messagingService.isStarted());
assertEquals(messagingService.getServer().getStorageManager().getClass(), NullStorageManager.class);
@@ -83,7 +83,7 @@
public void testNewNullStorageMessagingServerDefault() throws Exception
{
- MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingServer();
+ MessagingService messagingService = MessagingServiceImpl.newNullStorageMessagingService();
messagingService.start();
assertTrue(messagingService.isStarted());
assertEquals(messagingService.getServer().getStorageManager().getClass(), NullStorageManager.class);
Modified: trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java 2008-12-09 17:50:53 UTC (rev 5493)
+++ trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java 2008-12-09 21:39:37 UTC (rev 5494)
@@ -111,14 +111,11 @@
if (realFiles)
{
- service = MessagingServiceImpl.newNioStorageMessagingServer(configuration,
- getJournalDir(),
- getBindingsDir(),
- getLargeMessagesDir());
+ service = MessagingServiceImpl.newMessagingService(configuration);
}
else
{
- service = MessagingServiceImpl.newNullStorageMessagingServer(configuration);
+ service = MessagingServiceImpl.newNullStorageMessagingService(configuration);
}
for (Map.Entry<String, QueueSettings> setting : settings.entrySet())
@@ -161,6 +158,7 @@
{
Configuration configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir());
configuration.setJournalMinFiles(2);
configuration.setJournalDirectory(getJournalDir());
configuration.setJournalFileSize(100 * 1024);
More information about the jboss-cvs-commits
mailing list