You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2021/11/18 09:44:25 UTC
[activemq-artemis] branch main updated: ARTEMIS-3581 - allow max-size-bytes=0 configuration force paging for an address, independent of the page-size-bytes
This is an automated email from the ASF dual-hosted git repository.
gtully pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 8d50aa9 ARTEMIS-3581 - allow max-size-bytes=0 configuration force paging for an address, independent of the page-size-bytes
8d50aa9 is described below
commit 8d50aa916c0cfff2540a8614dba52015144e882e
Author: gtully <ga...@gmail.com>
AuthorDate: Tue Nov 16 16:15:39 2021 +0000
ARTEMIS-3581 - allow max-size-bytes=0 configuration force paging for an address, independent of the page-size-bytes
---
.../activemq/artemis/core/paging/impl/PagingStoreImpl.java | 13 ++-----------
docs/user-manual/en/paging.md | 5 +++--
.../artemis/tests/integration/paging/PagingTest.java | 2 +-
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
index 3133096..8cd3ed3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
@@ -166,15 +166,6 @@ public class PagingStoreImpl implements PagingStore {
applySetting(addressSettings);
- if (addressFullMessagePolicy == AddressFullMessagePolicy.PAGE && maxSize != -1 && pageSize >= maxSize) {
- throw new IllegalStateException("pageSize for address " + address +
- " >= maxSize. Normally pageSize should" +
- " be significantly smaller than maxSize, ms: " +
- maxSize +
- " ps " +
- pageSize);
- }
-
this.executor = executor;
this.pagingManager = pagingManager;
@@ -259,8 +250,8 @@ public class PagingStoreImpl implements PagingStore {
@Override
public long getMaxSize() {
- if (maxSize < 0) {
- // if maxSize < 0, we will return 2 pages for depage purposes
+ if (maxSize <= 0) {
+ // if maxSize <= 0, we will return 2 pages for de-page purposes
return pageSize * 2;
} else {
return maxSize;
diff --git a/docs/user-manual/en/paging.md b/docs/user-manual/en/paging.md
index bd8e795..65e007c 100644
--- a/docs/user-manual/en/paging.md
+++ b/docs/user-manual/en/paging.md
@@ -53,14 +53,15 @@ You can configure the location of the paging folder in `broker.xml`.
## Paging Mode
As soon as messages delivered to an address exceed the configured size,
-that address alone goes into page mode.
+that address alone goes into page mode. If max-size-bytes == 0, an address
+will immediately enter into page mode.
> **Note:**
>
> Paging is done individually per address. If you configure a max-size-bytes
> for an address, that means each matching address will have a maximum size
> that you specified. It DOES NOT mean that the total overall size of all
-> matching addresses is limited to max-size-bytes.
+> matching addresses is limited to max-size-bytes. Use [global-max-size](#global-max-size) for that!
### Configuration
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
index 86de254..acee2df 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
@@ -4648,7 +4648,7 @@ public class PagingTest extends ActiveMQTestBase {
addresses.put("#", new AddressSettings());
- AddressSettings pagedDestination = new AddressSettings().setPageSizeBytes(1024).setMaxSizeBytes(10 * 1024);
+ AddressSettings pagedDestination = new AddressSettings().setPageSizeBytes(1024).setMaxSizeBytes(0);
addresses.put(PAGED_ADDRESS.toString(), pagedDestination);