[ 
https://issues.apache.org/jira/browse/ARTEMIS-3178?focusedWorklogId=842530&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-842530
 ]

ASF GitHub Bot logged work on ARTEMIS-3178:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jan/23 11:25
            Start Date: 31/Jan/23 11:25
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on code in PR #4351:
URL: https://github.com/apache/activemq-artemis/pull/4351#discussion_r1091788208


##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java:
##########
@@ -1082,6 +1083,68 @@ public void 
testAddressSettingsPageLimitInvalidConfiguration2() throws Throwable
 
       String randomString = RandomUtil.randomString();
 
+      properties.put("addressSettings.#.expiryAddress", randomString);
+      properties.put("addressSettings.#.pageLimitMessages", "300");
+      // properties.put("addressSettings.#.pageLimitBytes", "300000"); out on 
purpose
+      //properties.put("addressSettings.#.pageFullMessagePolicy", "DROP"); // 
removing the pageFull on purpose

Review Comment:
   The commented out code seems out of place (and inconsistently 
indented)...why not just have the comment explain pageLimitBytes and 
pageFullMessagePolicy are missing to test the validation of them being missing. 
Which the existing comments dont even really make clear.



##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java:
##########
@@ -1082,6 +1083,68 @@ public void 
testAddressSettingsPageLimitInvalidConfiguration2() throws Throwable
 
       String randomString = RandomUtil.randomString();
 
+      properties.put("addressSettings.#.expiryAddress", randomString);
+      properties.put("addressSettings.#.pageLimitMessages", "300");
+      // properties.put("addressSettings.#.pageLimitBytes", "300000"); out on 
purpose
+      //properties.put("addressSettings.#.pageFullMessagePolicy", "DROP"); // 
removing the pageFull on purpose
+
+      configuration.parsePrefixedProperties(properties, null);
+
+      Assert.assertEquals(1, configuration.getAddressSettings().size());
+      Assert.assertEquals(SimpleString.toSimpleString(randomString), 
configuration.getAddressSettings().get("#").getExpiryAddress());
+      Assert.assertEquals((Long)300L, 
configuration.getAddressSettings().get("#").getPageLimitMessages());
+      Assert.assertEquals(null, 
configuration.getAddressSettings().get("#").getPageLimitBytes());
+      Assert.assertEquals(null, 
configuration.getAddressSettings().get("#").getPageFullMessagePolicy());
+
+      PagingStore storeImpl = new PagingStoreImpl(new SimpleString("Test"), 
(ScheduledExecutorService) null, 100L, Mockito.mock(PagingManager.class), 
Mockito.mock(StorageManager.class), Mockito.mock(SequentialFileFactory.class), 
Mockito.mock(PagingStoreFactory.class), new SimpleString("Test"), 
configuration.getAddressSettings().get("#"), null, null, true);
+
+      Assert.assertEquals(null, storeImpl.getPageLimitMessages());
+      Assert.assertEquals(null, storeImpl.getPageLimitBytes());
+      Assert.assertEquals(null, storeImpl.getPageFullMessagePolicy());
+      Assert.assertTrue(AssertionLoggerHandler.findText("AMQ224125"));
+   }
+
+   @Test
+   public void testAddressSettingsPageLimitInvalidConfiguration3() throws 
Throwable {
+      AssertionLoggerHandler.startCapture();
+      runAfter(AssertionLoggerHandler::stopCapture);
+      ConfigurationImpl configuration = new ConfigurationImpl();
+
+      Properties properties = new Properties();
+
+      String randomString = RandomUtil.randomString();
+
+      properties.put("addressSettings.#.expiryAddress", randomString);
+      //properties.put("addressSettings.#.pageLimitMessages", "300");
+      properties.put("addressSettings.#.pageLimitBytes", "300000"); // 
removing this on purpose
+      //properties.put("addressSettings.#.pageFullMessagePolicy", "DROP"); // 
removing the pageFull on purpose

Review Comment:
   As before, just comment about pageLimitMessages and pageFullMessagePolicy 
being missing to test that, without the commented-out code.
   
   The "// removing this on purpose" comment doesnt actually match up, with it 
not being removed.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 842530)
    Time Spent: 3h 10m  (was: 3h)

> Provide a way to limit the size of an address after paged
> ---------------------------------------------------------
>
>                 Key: ARTEMIS-3178
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3178
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker, Configuration
>    Affects Versions: 2.17.0
>            Reporter: Gary Tully
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.28.0
>
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> I am adding three attributes to Address-settings:
>  * page-limit-bytes: Number of bytes. We will convert this metric into max 
> number of pages internally by dividing max-bytes / page-size. It will allow a 
> max based on an estimate.
>  * page-limit-messages: Number of messages
>  * page-full-message-policy: fail : drop
> We will now allow paging, until these max values and then fail or drop 
> messages.
> Once these values are retracted, the address will remain full until a period 
> where cleanup is kicked in by paging. So these values may have a certain 
> delay on being applied, but they should always be cleared once cleanup 
> happened.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to