[jboss-cvs] JBoss Messaging SVN: r5906 - in trunk: src/main/org/jboss/messaging/core/config and 17 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 19 17:48:29 EST 2009
Author: clebert.suconic at jboss.com
Date: 2009-02-19 17:48:29 -0500 (Thu, 19 Feb 2009)
New Revision: 5906
Modified:
trunk/src/config/jbm-configuration.xml
trunk/src/config/jbm-queues.xml
trunk/src/main/org/jboss/messaging/core/config/Configuration.java
trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
trunk/src/main/org/jboss/messaging/core/settings/impl/AddressSettings.java
trunk/src/schemas/jbm-configuration.xsd
trunk/tests/config/ConfigurationTest-full-config.xml
trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/MessageChunkTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/consumer/RedeliveryConsumerTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/paging/PagingServiceIntegrationTest.java
trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java
trunk/tests/src/org/jboss/messaging/tests/stress/chunk/MessageChunkStressTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationValidationTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreTestBase.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/settings/impl/AddressSettingsTest.java
trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
Log:
Config changes (default page size, rename strictUpdate and a few other tweaks)
Modified: trunk/src/config/jbm-configuration.xml
===================================================================
--- trunk/src/config/jbm-configuration.xml 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/config/jbm-configuration.xml 2009-02-19 22:48:29 UTC (rev 5906)
@@ -48,7 +48,7 @@
<backup>false</backup>
- <strict-update-delivery>false</strict-update-delivery>
+ <persist-count-before-delivery>false</persist-count-before-delivery>
<!--
<backup-connector-ref connector-name="netty-backup"/>
@@ -145,6 +145,8 @@
<paging-directory>data/paging</paging-directory>
+ <paging-global-watermark-size>10485760</paging-global-watermark-size>
+
<paging-max-global-size-bytes>104857600</paging-max-global-size-bytes>
<!-- Storage configuration -->
Modified: trunk/src/config/jbm-queues.xml
===================================================================
--- trunk/src/config/jbm-queues.xml 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/config/jbm-queues.xml 2009-02-19 22:48:29 UTC (rev 5906)
@@ -126,6 +126,7 @@
<expiry-address>queuejms.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>-1</max-size-bytes>
+ <page-size-bytes>10485760</page-size-bytes>
<distribution-policy-class>org.jboss.messaging.core.server.impl.RoundRobinDistributor</distribution-policy-class>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-settings>
Modified: trunk/src/main/org/jboss/messaging/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/Configuration.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/config/Configuration.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -51,9 +51,9 @@
void setClustered(boolean clustered);
- boolean isStrictUpdateDelivery();
+ boolean isPersistDeliveryCountBeforeDelivery();
- void setStrictUpdateDelivery(boolean strictUpdateDelivery);
+ void setPersistDeliveryCountBeforeDelivery(boolean persistDeliveryCountBeforeDelivery);
boolean isBackup();
@@ -209,9 +209,9 @@
void setPagingMaxGlobalSizeBytes(long maxGlobalSize);
- long getPagingDefaultSize();
+ int getPagingGlobalWatermarkSize();
- void setPagingDefaultSize(long pageSize);
+ void setPagingGlobalWatermarkSize(int pageWatermarkSize);
// Large Messages Properties ------------------------------------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -73,7 +73,7 @@
public static final int DEFAULT_PAGE_MAX_THREADS = 10;
- public static final long DEFAULT_PAGE_SIZE = 10 * 1024 * 1024;
+ public static final int DEFAULT_PAGE_WATERMARK_SIZE = 10 * 1024 * 1024;
public static final long DEFAULT_PAGE_MAX_GLOBAL_SIZE = -1;
@@ -143,7 +143,7 @@
protected boolean backup = DEFAULT_BACKUP;
- protected boolean strictUpdateDelivery = DEFAULT_STRICT_UPDATE_DELIVERY;
+ protected boolean persistDeliveryCountBeforeDelivery = DEFAULT_STRICT_UPDATE_DELIVERY;
protected long queueActivationTimeout = DEFAULT_QUEUE_ACTIVATION_TIMEOUT;
@@ -193,7 +193,7 @@
protected long pagingMaxGlobalSize = DEFAULT_PAGE_MAX_GLOBAL_SIZE;
- protected long pagingDefaultSize = DEFAULT_PAGE_SIZE;
+ protected int pageWatermarkSize = DEFAULT_PAGE_WATERMARK_SIZE;
protected String pagingDirectory = DEFAULT_PAGING_DIR;
@@ -257,19 +257,19 @@
}
/**
- * @return the strictUpdateDelivery
+ * @return the persistDeliveryCountBeforeDelivery
*/
- public boolean isStrictUpdateDelivery()
+ public boolean isPersistDeliveryCountBeforeDelivery()
{
- return strictUpdateDelivery;
+ return persistDeliveryCountBeforeDelivery;
}
/**
* @param strictJMS the strictJMS to set
*/
- public void setStrictUpdateDelivery(final boolean strictUpdateDelivery)
+ public void setPersistDeliveryCountBeforeDelivery(final boolean persistDeliveryCountBeforeDelivery)
{
- this.strictUpdateDelivery = strictUpdateDelivery;
+ this.persistDeliveryCountBeforeDelivery = persistDeliveryCountBeforeDelivery;
}
public void setBackup(final boolean backup)
@@ -670,17 +670,17 @@
/* (non-Javadoc)
* @see org.jboss.messaging.core.config.Configuration#getPagingDefaultSize()
*/
- public long getPagingDefaultSize()
+ public int getPagingGlobalWatermarkSize()
{
- return pagingDefaultSize;
+ return pageWatermarkSize;
}
/* (non-Javadoc)
* @see org.jboss.messaging.core.config.Configuration#setPagingDefaultSize(long)
*/
- public void setPagingDefaultSize(final long pageSize)
+ public void setPagingGlobalWatermarkSize(final int pageSize)
{
- pagingDefaultSize = pageSize;
+ pageWatermarkSize = pageSize;
}
public String getLargeMessagesDirectory()
@@ -770,6 +770,6 @@
cother.getScheduledThreadPoolMaxSize() == getScheduledThreadPoolMaxSize() &&
cother.getSecurityInvalidationInterval() == getSecurityInvalidationInterval() &&
cother.getManagementAddress().equals(getManagementAddress()) &&
- cother.getPagingDefaultSize() == getPagingDefaultSize();
+ cother.getPagingGlobalWatermarkSize() == getPagingGlobalWatermarkSize();
}
}
Modified: trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -89,7 +89,7 @@
backup = getBoolean(e, "backup", backup);
- strictUpdateDelivery = getBoolean(e, "strict-update-delivery", strictUpdateDelivery);
+ persistDeliveryCountBeforeDelivery = getBoolean(e, "persist-count-before-delivery", persistDeliveryCountBeforeDelivery);
queueActivationTimeout = getLong(e, "queue-activation-timeout", queueActivationTimeout);
@@ -261,8 +261,8 @@
pagingMaxGlobalSize = getLong(e, "paging-max-global-size-bytes", pagingMaxGlobalSize);
- pagingDefaultSize = getLong(e, "paging-default-size", pagingDefaultSize);
-
+ pageWatermarkSize = getInteger(e, "paging-global-watermark-size", pageWatermarkSize);
+
createJournalDir = getBoolean(e, "create-journal-dir", createJournalDir);
String s = getString(e, "journal-type", journalType.toString());
Modified: trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -125,7 +125,7 @@
/**
* @return
*/
- long getDefaultPageSize();
+ long getGlobalDepageWatermarkBytes();
/**
* @param transactionID
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -73,7 +73,7 @@
private final StorageManager storageManager;
- private final long defaultPageSize;
+ private final long globalDepageWatermarkBytes;
private final boolean syncNonTransactional;
@@ -91,14 +91,14 @@
final StorageManager storageManager,
final HierarchicalRepository<AddressSettings> addressSettingsRepository,
final long maxGlobalSize,
- final long defaultPageSize,
+ final long globalDepageWatermarkBytes,
final boolean syncNonTransactional,
final boolean backup)
{
pagingStoreFactory = pagingSPI;
this.addressSettingsRepository = addressSettingsRepository;
this.storageManager = storageManager;
- this.defaultPageSize = defaultPageSize;
+ this.globalDepageWatermarkBytes = globalDepageWatermarkBytes;
this.maxGlobalSize = maxGlobalSize;
this.syncNonTransactional = syncNonTransactional;
this.backup = backup;
@@ -188,9 +188,9 @@
pagingStoreFactory.setPostOffice(postOffice);
}
- public long getDefaultPageSize()
+ public long getGlobalDepageWatermarkBytes()
{
- return defaultPageSize;
+ return globalDepageWatermarkBytes;
}
public boolean isPaging(final SimpleString destination) throws Exception
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -154,14 +154,7 @@
maxSize = addressSettings.getMaxSizeBytes();
- if (addressSettings.getPageSizeBytes() != null)
- {
- pageSize = addressSettings.getPageSizeBytes();
- }
- else
- {
- pageSize = pagingManager.getDefaultPageSize();
- }
+ pageSize = addressSettings.getPageSizeBytes();
dropMessagesWhenFull = addressSettings.isDropMessagesWhenFull();
@@ -228,7 +221,7 @@
{
return storeName;
}
-
+
public void addSize(final long size) throws Exception
{
final long maxSize = getMaxSizeBytes();
@@ -286,16 +279,16 @@
log.trace(" globalDepage = " + pagingManager.isGlobalPageMode() +
"\n currentGlobalSize = " +
currentGlobalSize +
- "\n defaultPageSize = " +
- pagingManager.getDefaultPageSize() +
+ "\n GlobalWatermark = " +
+ pagingManager.getGlobalDepageWatermarkBytes() +
"\n maxGlobalSize = " +
maxGlobalSize +
"\n maxGlobalSize - defaultPageSize = " +
- (maxGlobalSize - pagingManager.getDefaultPageSize()));
+ (maxGlobalSize - pagingManager.getGlobalDepageWatermarkBytes()));
}
if (maxGlobalSize > 0 && pagingManager.isGlobalPageMode() &&
- currentGlobalSize < maxGlobalSize - pagingManager.getDefaultPageSize())
+ currentGlobalSize < maxGlobalSize - pagingManager.getGlobalDepageWatermarkBytes())
{
pagingManager.startGlobalDepage();
}
@@ -1035,11 +1028,9 @@
// To be used on isDropMessagesWhenFull
private boolean isDrop()
{
- return (getMaxSizeBytes() > 0 && getAddressSize() > getMaxSizeBytes()) ||
- (pagingManager.getMaxGlobalSize() > 0 && pagingManager.getGlobalSize() > pagingManager.getMaxGlobalSize());
+ return (getMaxSizeBytes() > 0 && getAddressSize() > getMaxSizeBytes()) || (pagingManager.getMaxGlobalSize() > 0 && pagingManager.getGlobalSize() > pagingManager.getMaxGlobalSize());
}
-
// Inner classes -------------------------------------------------
private class DepageRunnable implements Runnable
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -780,7 +780,7 @@
storageManager,
addressSettingsRepository,
configuration.getPagingMaxGlobalSizeBytes(),
- configuration.getPagingDefaultSize(),
+ configuration.getPagingGlobalWatermarkSize(),
configuration.isJournalSyncNonTransactional(),
configuration.isBackup());
}
@@ -949,7 +949,7 @@
autoCommitSends,
autoCommitAcks,
preAcknowledge,
- configuration.isStrictUpdateDelivery(),
+ configuration.isPersistDeliveryCountBeforeDelivery(),
xa,
connection,
storageManager,
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -911,7 +911,7 @@
}
// we must hold one reference, or the file will be deleted before it could be delivered
- if (preAcknowledge)
+ if (preAcknowledge && !browseOnly)
{
if (pendingLargeMessage.decrementRefCount() == 0)
{
Modified: trunk/src/main/org/jboss/messaging/core/settings/impl/AddressSettings.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/settings/impl/AddressSettings.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/main/org/jboss/messaging/core/settings/impl/AddressSettings.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -46,6 +46,8 @@
public static final Integer DEFAULT_MAX_SIZE_BYTES = -1;
public static final Boolean DEFAULT_DROP_MESSAGES_WHEN_FULL = Boolean.FALSE;
+
+ public static final Integer DEFAULT_PAGE_SIZE = 10 * 1024 * 1024;
public static final Integer DEFAULT_MAX_DELIVERY_ATTEMPTS = 10;
@@ -91,7 +93,7 @@
public Integer getPageSizeBytes()
{
- return pageSizeBytes;
+ return pageSizeBytes != null ? this.pageSizeBytes : DEFAULT_PAGE_SIZE;
}
public Boolean isDropMessagesWhenFull()
Modified: trunk/src/schemas/jbm-configuration.xsd
===================================================================
--- trunk/src/schemas/jbm-configuration.xsd 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/src/schemas/jbm-configuration.xsd 2009-02-19 22:48:29 UTC (rev 5906)
@@ -96,7 +96,7 @@
<xsd:element name="backup" type="xsd:boolean"
maxOccurs="1" minOccurs="0">
</xsd:element>
- <xsd:element name="strict-update-delivery" type="xsd:boolean"
+ <xsd:element name="persist-count-before-delivery" type="xsd:boolean"
maxOccurs="1" minOccurs="0">
</xsd:element>
<xsd:element name="backup-connector-ref"
@@ -132,7 +132,7 @@
<xsd:element name="paging-directory" type="xsd:string"
maxOccurs="1" minOccurs="0">
</xsd:element>
- <xsd:element name="paging-default-size" type="xsd:unsignedLong"
+ <xsd:element name="paging-global-watermark-size" type="xsd:positiveInteger"
maxOccurs="1" minOccurs="0">
</xsd:element>
<xsd:element name="paging-max-global-size-bytes"
Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/config/ConfigurationTest-full-config.xml 2009-02-19 22:48:29 UTC (rev 5906)
@@ -24,6 +24,7 @@
</remoting-interceptors>
<queue-activation-timeout>12456</queue-activation-timeout>
<backup>true</backup>
+ <persist-count-before-delivery>true</persist-count-before-delivery>
<backup-connector-ref connector-name="backup-connector"/>
<connector name="connector">
<factory-class>org.jboss.messaging.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
@@ -155,7 +156,7 @@
</cluster-connection>
<paging-max-threads>2</paging-max-threads>
<paging-directory>pagingdir</paging-directory>
- <paging-default-size>123</paging-default-size>
+ <paging-global-watermark-size>123</paging-global-watermark-size>
<paging-max-global-size-bytes>4567</paging-max-global-size-bytes>
<bindings-directory>somedir</bindings-directory>
<create-bindings-dir>false</create-bindings-dir>
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -87,6 +87,7 @@
final boolean useFile,
final boolean preAck,
final boolean sendingBlocking,
+ final boolean testBrowser,
final int numberOfMessages,
final int numberOfIntegers,
final int waitOnConsumer,
@@ -96,6 +97,7 @@
useFile,
preAck,
sendingBlocking,
+ testBrowser,
numberOfMessages,
numberOfIntegers,
waitOnConsumer,
@@ -108,6 +110,7 @@
final boolean useFile,
final boolean preAck,
final boolean sendingBlocking,
+ final boolean testBrowser,
final int numberOfMessages,
final int numberOfIntegers,
final int waitOnConsumer,
@@ -204,7 +207,7 @@
if (realFiles)
{
messagingService.stop();
-
+
messagingService = createService(realFiles);
messagingService.start();
@@ -215,74 +218,91 @@
ClientConsumer consumer = null;
- if (realFiles)
+ // If delayed deliveries... it doesn't make sense with Browsing
+ for (int iteration = (testBrowser ? 0 : 1); iteration < 2; iteration++)
{
- consumer = session.createFileConsumer(new File(getClientLargeMessagesDir()), ADDRESS);
- }
- else
- {
- consumer = session.createConsumer(ADDRESS);
- }
- session.start();
+ System.out.println("Iteration: " + iteration);
- for (int i = 0; i < numberOfMessages; i++)
- {
- long start = System.currentTimeMillis();
-
- ClientMessage message = consumer.receive(waitOnConsumer + delayDelivery);
-
- assertNotNull(message);
-
+ // first time with a browser
if (realFiles)
{
- assertTrue(message instanceof ClientFileMessage);
+ consumer = session.createFileConsumer(new File(getClientLargeMessagesDir()),
+ ADDRESS,
+ null,
+ iteration == 0);
}
-
- if (testTime)
+ else
{
- System.out.println("Message received in " + (System.currentTimeMillis() - start));
+ consumer = session.createConsumer(ADDRESS, null, iteration == 0);
}
- start = System.currentTimeMillis();
- if (delayDelivery > 0)
- {
- long originalTime = (Long)message.getProperty(new SimpleString("original-time"));
- assertTrue((System.currentTimeMillis() - originalTime) + "<" + delayDelivery,
- System.currentTimeMillis() - originalTime >= delayDelivery);
- }
+ session.start();
- if (!preAck)
+ for (int i = 0; i < numberOfMessages; i++)
{
- message.acknowledge();
- }
+ long start = System.currentTimeMillis();
- assertNotNull(message);
+ ClientMessage message = consumer.receive(waitOnConsumer + delayDelivery);
- if (delayDelivery <= 0)
- {
- // right now there is no guarantee of ordered delivered on multiple scheduledMessages with the same
- // scheduled delivery time
- assertEquals(i, ((Integer)message.getProperty(new SimpleString("counter-message"))).intValue());
- }
+ assertNotNull(message);
- if (!testTime)
- {
- if (message instanceof ClientFileMessage)
+ if (realFiles)
{
- checkFileRead(((ClientFileMessage)message).getFile(), numberOfIntegers);
+ assertTrue(message instanceof ClientFileMessage);
}
- else
+
+ if (testTime)
{
- MessagingBuffer buffer = message.getBody();
- buffer.rewind();
- assertEquals(numberOfIntegers * DataConstants.SIZE_INT, buffer.limit());
- for (int b = 0; b < numberOfIntegers; b++)
+ System.out.println("Message received in " + (System.currentTimeMillis() - start));
+ }
+ start = System.currentTimeMillis();
+
+ if (delayDelivery > 0)
+ {
+ long originalTime = (Long)message.getProperty(new SimpleString("original-time"));
+ assertTrue((System.currentTimeMillis() - originalTime) + "<" + delayDelivery,
+ System.currentTimeMillis() - originalTime >= delayDelivery);
+ }
+
+ if (!preAck)
+ {
+ message.acknowledge();
+ }
+
+ assertNotNull(message);
+
+ if (delayDelivery <= 0)
+ {
+ // right now there is no guarantee of ordered delivered on multiple scheduledMessages with the same
+ // scheduled delivery time
+ assertEquals(i, ((Integer)message.getProperty(new SimpleString("counter-message"))).intValue());
+ }
+
+ if (!testTime)
+ {
+ if (message instanceof ClientFileMessage)
{
- assertEquals(b, buffer.getInt());
+ checkFileRead(((ClientFileMessage)message).getFile(), numberOfIntegers);
}
+ else
+ {
+ MessagingBuffer buffer = message.getBody();
+ buffer.rewind();
+ assertEquals(numberOfIntegers * DataConstants.SIZE_INT, buffer.limit());
+ for (int b = 0; b < numberOfIntegers; b++)
+ {
+ assertEquals(b, buffer.getInt());
+ }
+ }
}
}
+
+ if (iteration == 0)
+ {
+ consumer.close();
+ session.rollback();
+ }
}
session.close();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/MessageChunkTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/MessageChunkTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/MessageChunkTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -111,7 +111,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(20 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -285,32 +285,32 @@
public void testMessageChunkFilePersistence() throws Exception
{
- testChunks(true, false, false, false, 100, 262144, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, false, false, false, true, 100, 262144, RECEIVE_WAIT_TIME, 0);
}
public void testMessageChunkFilePersistenceBlocked() throws Exception
{
- testChunks(true, false, false, true, 100, 262144, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, false, false, true, true, 100, 262144, RECEIVE_WAIT_TIME, 0);
}
public void testMessageChunkFilePersistenceBlockedPreACK() throws Exception
{
- testChunks(true, false, true, true, 100, 262144, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, false, true, true, true, 100, 262144, RECEIVE_WAIT_TIME, 0);
}
public void testMessageChunkFilePersistenceDelayed() throws Exception
{
- testChunks(true, false, false, false, 1, 50000, RECEIVE_WAIT_TIME, 2000);
+ testChunks(true, false, false, false, false, 1, 50000, RECEIVE_WAIT_TIME, 2000);
}
public void testMessageChunkNullPersistence() throws Exception
{
- testChunks(false, false, false, false, 1, 50000, RECEIVE_WAIT_TIME, 0);
+ testChunks(false, false, false, false, true, 1, 50000, RECEIVE_WAIT_TIME, 0);
}
public void testMessageChunkNullPersistenceDelayed() throws Exception
{
- testChunks(false, false, false, false, 100, 50000, RECEIVE_WAIT_TIME, 100);
+ testChunks(false, false, false, false, false, 100, 50000, RECEIVE_WAIT_TIME, 100);
}
public void testPageOnLargeMessage() throws Exception
@@ -326,44 +326,44 @@
public void testSendfileMessage() throws Exception
{
- testChunks(true, true, false, false, 100, 50000, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, true, false, false, true, 100, 50000, RECEIVE_WAIT_TIME, 0);
}
public void testSendfileMessageOnNullPersistence() throws Exception
{
- testChunks(false, true, false, false, 100, 50000, RECEIVE_WAIT_TIME, 0);
+ testChunks(false, true, false, false, true, 100, 50000, RECEIVE_WAIT_TIME, 0);
}
public void testSendfileMessageOnNullPersistenceSmallMessage() throws Exception
{
- testChunks(false, true, false, true, 100, 100, RECEIVE_WAIT_TIME, 0);
+ testChunks(false, true, false, true, true, 100, 100, RECEIVE_WAIT_TIME, 0);
}
public void testSendfileMessageSmallMessage() throws Exception
{
- testChunks(true, true, false, false, 100, 4, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, true, false, false, true, 100, 4, RECEIVE_WAIT_TIME, 0);
}
public void testSendRegularMessageNullPersistence() throws Exception
{
- testChunks(false, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 0);
+ testChunks(false, false, false, false, true, 100, 100, RECEIVE_WAIT_TIME, 0);
}
public void testSendRegularMessageNullPersistenceDelayed() throws Exception
{
- testChunks(false, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 1000);
+ testChunks(false, false, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 1000);
}
public void testSendRegularMessagePersistence() throws Exception
{
- testChunks(true, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 0);
+ testChunks(true, false, false, false, true, 100, 100, RECEIVE_WAIT_TIME, 0);
}
public void testSendRegularMessagePersistenceDelayed() throws Exception
{
- testChunks(true, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 1000);
+ testChunks(true, false, false, false, false, 100, 100, RECEIVE_WAIT_TIME, 1000);
}
public void testTwoBindingsTwoStartedConsumers() throws Exception
@@ -629,7 +629,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(20 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
messagingService = createService(realFiles, config, new HashMap<String, AddressSettings>());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -84,7 +84,7 @@
setUpFileBased(maxGlobalSize, 20 * 1024);
}
- protected void setUpFileBased(final long maxGlobalSize, final long pageSize) throws Exception
+ protected void setUpFileBased(final long maxGlobalSize, final int pageSize) throws Exception
{
deleteDirectory(new File(getTestDir()));
@@ -98,7 +98,7 @@
backupConf.setJournalFileSize(100 * 1024);
backupConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
- backupConf.setPagingDefaultSize(pageSize);
+ backupConf.setPagingGlobalWatermarkSize(pageSize);
backupConf.setSecurityEnabled(false);
backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
@@ -120,7 +120,7 @@
liveConf.setPagingDirectory(getPageDir(getTestDir() + "/live"));
liveConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
- liveConf.setPagingDefaultSize(pageSize);
+ liveConf.setPagingGlobalWatermarkSize(pageSize);
liveConf.setJournalFileSize(100 * 1024);
liveConf.setSecurityEnabled(false);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/consumer/ConsumerTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -32,6 +32,7 @@
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.server.Messaging;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.Queue;
@@ -286,16 +287,21 @@
public void testConsumerBrowserMessages() throws Exception
{
- testConsumerBrowserMessagesArentAcked(false);
+ testConsumerBrowserMessagesArentAcked(false, 0);
}
public void testConsumerBrowserMessagesPreACK() throws Exception
{
- testConsumerBrowserMessagesArentAcked(false);
+ testConsumerBrowserMessagesArentAcked(true, 0);
}
+ public void testConsumerBrowserMessagesDelayedDelivery() throws Exception
+ {
+ testConsumerBrowserMessagesArentAcked(false, 100);
+ }
+
- private void testConsumerBrowserMessagesArentAcked(boolean preACK) throws Exception
+ private void testConsumerBrowserMessagesArentAcked(boolean preACK, long delayedDelivery) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
@@ -310,8 +316,14 @@
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = createMessage(session, "m" + i);
+ if (delayedDelivery > 0)
+ {
+ message.putLongProperty(MessageImpl.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + delayedDelivery);
+ }
producer.send(message);
}
+
+ Thread.sleep(100);
ClientConsumer consumer = session.createConsumer(QUEUE, null, true);
@@ -319,6 +331,7 @@
{
ClientMessage message2 = consumer.receive(1000);
+ assertNotNull(message2);
assertEquals("m" + i, message2.getBody().getString());
}
// assert that all the messages are there and none have been acked
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/consumer/RedeliveryConsumerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/consumer/RedeliveryConsumerTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/consumer/RedeliveryConsumerTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -231,17 +231,17 @@
}
/**
- * @param strictUpdateDelivery
+ * @param persistDeliveryCountBeforeDelivery
* @throws Exception
* @throws MessagingException
*/
- private void setUp(final boolean strictUpdateDelivery) throws Exception, MessagingException
+ private void setUp(final boolean persistDeliveryCountBeforeDelivery) throws Exception, MessagingException
{
Configuration config = createFileConfig();
config.setJournalFileSize(10 * 1024);
config.setJournalMinFiles(2);
config.setSecurityEnabled(false);
- config.setStrictUpdateDelivery(strictUpdateDelivery);
+ config.setPersistDeliveryCountBeforeDelivery(persistDeliveryCountBeforeDelivery);
messagingService = createService(true, config);
messagingService.start();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -104,7 +104,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -152,7 +152,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService service = newMessagingService(config);
@@ -267,7 +267,13 @@
server.setSecurityManager(securityManager);
server.setManagementService(managementService);
+
+ AddressSettings defaultSetting = new AddressSettings();
+ defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
return new MessagingServiceImpl(server, storageManager, remotingService);
}
@@ -286,7 +292,7 @@
super.getStorageManager(),
super.getAddressSettingsRepository(),
super.getConfiguration().getPagingMaxGlobalSizeBytes(),
- super.getConfiguration().getPagingDefaultSize(),
+ super.getConfiguration().getPagingGlobalWatermarkSize(),
super.getConfiguration().isJournalSyncNonTransactional(),
false);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/paging/PagingServiceIntegrationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/paging/PagingServiceIntegrationTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/paging/PagingServiceIntegrationTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -82,7 +82,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -210,7 +210,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -350,7 +350,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -482,7 +482,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -561,7 +561,7 @@
Configuration config = createDefaultConfig();
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
@@ -683,7 +683,7 @@
set.setMaxSizeBytes(10 * 1024);
}
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, settings);
@@ -834,7 +834,7 @@
int NUMBER_OF_MESSAGES = 2;
config.setPagingMaxGlobalSizeBytes(100 * 1024);
- config.setPagingDefaultSize(10 * 1024);
+ config.setPagingGlobalWatermarkSize(10 * 1024);
MessagingService messagingService = createService(true, config, new HashMap<String, AddressSettings>());
Modified: trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -48,7 +48,7 @@
public void testMessageChunkFilePersistence1G() throws Exception
{
- testChunks(true, true, false, true, 2, 268435456, 300000, 0, -1, true);
+ testChunks(true, true, false, true, false, 2, 268435456, 300000, 0, -1, true);
}
// Package protected ---------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/stress/chunk/MessageChunkStressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/stress/chunk/MessageChunkStressTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/stress/chunk/MessageChunkStressTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -53,7 +53,7 @@
public void testMessageChunkFilePersistence1M() throws Exception
{
- //testChunks(true, true, false, true, 1000, 262144, 120000, 0, -1, false);
+ // testChunks(true, true, false, true, false, 1000, 262144, 120000, 0, -1, false);
// Hudson seems to be failing because of disk full. Temporarily commenting it out
}
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationValidationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationValidationTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationValidationTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -80,6 +80,8 @@
FileConfiguration fc = new FileConfiguration();
fc.setConfigurationUrl("ConfigurationTest-full-config.xml");
fc.start();
+
+ assertEquals(true, fc.isPersistDeliveryCountBeforeDelivery());
}
// Package protected ---------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -123,7 +123,7 @@
assertEquals(ConfigurationImpl.DEFAULT_PAGE_MAX_GLOBAL_SIZE, conf.getPagingMaxGlobalSizeBytes());
- assertEquals(ConfigurationImpl.DEFAULT_PAGE_SIZE, conf.getPagingDefaultSize());
+ assertEquals(ConfigurationImpl.DEFAULT_PAGE_WATERMARK_SIZE, conf.getPagingGlobalWatermarkSize());
assertEquals(ConfigurationImpl.DEFAULT_LARGE_MESSAGES_DIR, conf.getLargeMessagesDirectory());
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreTestBase.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreTestBase.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -373,7 +373,7 @@
protected PagingManager createMockManager()
{
PagingManager mockManager = EasyMock.createNiceMock(PagingManager.class);
- org.easymock.EasyMock.expect(mockManager.getDefaultPageSize()).andStubReturn(ConfigurationImpl.DEFAULT_PAGE_SIZE);
+ org.easymock.EasyMock.expect(mockManager.getGlobalDepageWatermarkBytes()).andStubReturn(ConfigurationImpl.DEFAULT_PAGE_WATERMARK_SIZE);
EasyMock.replay(mockManager);
return mockManager;
}
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/settings/impl/AddressSettingsTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/settings/impl/AddressSettingsTest.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/settings/impl/AddressSettingsTest.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -35,15 +35,15 @@
public void testDefaults()
{
AddressSettings addressSettings = new AddressSettings();
- assertEquals(addressSettings.getDistributionPolicy().getClass(), AddressSettings.DEFAULT_DISTRIBUTION_POLICY_CLASS);
- assertEquals(addressSettings.getDistributionPolicyClass(), null);
- assertEquals(addressSettings.getDeadLetterAddress(), null);
- assertEquals(addressSettings.getExpiryAddress(), null);
- assertEquals(addressSettings.getMaxDeliveryAttempts(), AddressSettings.DEFAULT_MAX_DELIVERY_ATTEMPTS);
+ assertEquals(AddressSettings.DEFAULT_DISTRIBUTION_POLICY_CLASS, addressSettings.getDistributionPolicy().getClass());
+ assertEquals(null, addressSettings.getDistributionPolicyClass());
+ assertEquals(null, addressSettings.getDeadLetterAddress());
+ assertEquals(null, addressSettings.getExpiryAddress());
+ assertEquals(AddressSettings.DEFAULT_MAX_DELIVERY_ATTEMPTS, addressSettings.getMaxDeliveryAttempts());
assertEquals(addressSettings.getMaxSizeBytes(), AddressSettings.DEFAULT_MAX_SIZE_BYTES);
- assertEquals(addressSettings.getPageSizeBytes(), null);
- assertEquals(addressSettings.getMessageCounterHistoryDayLimit(), AddressSettings.DEFAULT_MESSAGE_COUNTER_HISTORY_DAY_LIMIT);
- assertEquals(addressSettings.getRedeliveryDelay(), AddressSettings.DEFAULT_REDELIVER_DELAY);
+ assertEquals(AddressSettings.DEFAULT_PAGE_SIZE, addressSettings.getPageSizeBytes());
+ assertEquals(AddressSettings.DEFAULT_MESSAGE_COUNTER_HISTORY_DAY_LIMIT, addressSettings.getMessageCounterHistoryDayLimit());
+ assertEquals(AddressSettings.DEFAULT_REDELIVER_DELAY, addressSettings.getRedeliveryDelay());
}
Modified: trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java 2009-02-19 19:09:40 UTC (rev 5905)
+++ trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java 2009-02-19 22:48:29 UTC (rev 5906)
@@ -129,6 +129,11 @@
{
service.getServer().getAddressSettingsRepository().addMatch(setting.getKey(), setting.getValue());
}
+
+ AddressSettings defaultSetting = new AddressSettings();
+ defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+
+ service.getServer().getAddressSettingsRepository().addMatch("#", defaultSetting);
return service;
}
More information about the jboss-cvs-commits
mailing list