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

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

                Author: ASF GitHub Bot
            Created on: 23/Jun/20 18:09
            Start Date: 23/Jun/20 18:09
    Worklog Time Spent: 10m 
      Work Description: k-wall commented on a change in pull request #3199:
URL: https://github.com/apache/activemq-artemis/pull/3199#discussion_r444413620



##########
File path: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
##########
@@ -1309,6 +1309,265 @@ public void testAddressSettings() throws Exception {
 
    }
 
+   @Test
+   public void testRemoveAddressSettingsEffective() throws Exception {
+      ActiveMQServerControl serverControl = createManagementControl();
+      String addr = "test";
+      String root = "#";
+
+      String DLA = "someDLA";
+      String expiryAddress = "someExpiry";
+      long expiryDelay = RandomUtil.randomPositiveLong();
+      long minExpiryDelay = 10000;
+      long maxExpiryDelay = 20000;
+      boolean lastValueQueue = true;
+      int deliveryAttempts = 1;
+      long maxSizeBytes = 20;
+      int pageSizeBytes = 10;
+      int pageMaxCacheSize = 7;
+      long redeliveryDelay = 4;
+      double redeliveryMultiplier = 1;
+      long maxRedeliveryDelay = 1000;
+      long redistributionDelay = 5;
+      boolean sendToDLAOnNoRoute = true;
+      String addressFullMessagePolicy = "PAGE";
+      long slowConsumerThreshold = 5;
+      long slowConsumerCheckPeriod = 10;
+      String slowConsumerPolicy = 
SlowConsumerPolicy.getType(RandomUtil.randomPositiveInt() % 2).toString();
+      boolean autoCreateJmsQueues = RandomUtil.randomBoolean();
+      boolean autoDeleteJmsQueues = RandomUtil.randomBoolean();
+      boolean autoCreateJmsTopics = RandomUtil.randomBoolean();
+      boolean autoDeleteJmsTopics = RandomUtil.randomBoolean();
+      boolean autoCreateQueues = RandomUtil.randomBoolean();
+      boolean autoDeleteQueues = RandomUtil.randomBoolean();
+      boolean autoCreateAddresses = RandomUtil.randomBoolean();
+      boolean autoDeleteAddresses = RandomUtil.randomBoolean();
+      String configDeleteQueues = 
DeletionPolicy.getType(RandomUtil.randomPositiveInt() % 2).toString();
+      String configDeleteAddresses = 
DeletionPolicy.getType(RandomUtil.randomPositiveInt() % 2).toString();
+      long maxSizeBytesRejectThreshold = RandomUtil.randomPositiveLong();
+      String defaultLastValueKey = RandomUtil.randomString();
+      boolean defaultNonDestructive = RandomUtil.randomBoolean();
+      boolean defaultExclusiveQueue = RandomUtil.randomBoolean();
+      boolean defaultGroupRebalance = RandomUtil.randomBoolean();
+      int defaultGroupBuckets = RandomUtil.randomPositiveInt();
+      String defaultGroupFirstKey = RandomUtil.randomString();
+      int defaultMaxConsumers = RandomUtil.randomPositiveInt();
+      boolean defaultPurgeOnNoConsumers = RandomUtil.randomBoolean();
+      int defaultConsumersBeforeDispatch = RandomUtil.randomPositiveInt();
+      long defaultDelayBeforeDispatch = RandomUtil.randomPositiveLong();
+      String defaultQueueRoutingType = RoutingType.getType((byte) 
(RandomUtil.randomPositiveInt() % 2)).toString();
+      String defaultAddressRoutingType = RoutingType.getType((byte) 
(RandomUtil.randomPositiveInt() % 2)).toString();
+      int defaultConsumerWindowSize = RandomUtil.randomPositiveInt();
+      long defaultRingSize = RandomUtil.randomPositiveLong();
+      boolean autoDeleteCreatedQueues = RandomUtil.randomBoolean();
+      long autoDeleteQueuesDelay = RandomUtil.randomPositiveLong();
+      long autoDeleteQueuesMessageCount = RandomUtil.randomPositiveLong();
+      long autoDeleteAddressesDelay = RandomUtil.randomPositiveLong();
+      double redeliveryCollisionAvoidanceFactor = RandomUtil.randomDouble();
+      long retroactiveMessageCount = RandomUtil.randomPositiveLong();
+      boolean autoCreateDeadLetterResources = RandomUtil.randomBoolean();
+      String deadLetterQueuePrefix = RandomUtil.randomString();
+      String deadLetterQueueSuffix = RandomUtil.randomString();
+      boolean autoCreateExpiryResources = RandomUtil.randomBoolean();
+      String expiryQueuePrefix = RandomUtil.randomString();
+      String expiryQueueSuffix = RandomUtil.randomString();
+      boolean enableMetrics = RandomUtil.randomBoolean();
+
+      serverControl.addAddressSettings(root,
+              DLA,
+              expiryAddress,
+              expiryDelay,
+              lastValueQueue,
+              deliveryAttempts,
+              maxSizeBytes,
+              pageSizeBytes,
+              pageMaxCacheSize,
+              redeliveryDelay,
+              redeliveryMultiplier,
+              maxRedeliveryDelay,
+              redistributionDelay,
+              sendToDLAOnNoRoute,
+              addressFullMessagePolicy,
+              slowConsumerThreshold,
+              slowConsumerCheckPeriod,
+              slowConsumerPolicy,
+              autoCreateJmsQueues,
+              autoDeleteJmsQueues,
+              autoCreateJmsTopics,
+              autoDeleteJmsTopics,
+              autoCreateQueues,
+              autoDeleteQueues,
+              autoCreateAddresses,
+              autoDeleteAddresses,
+              configDeleteQueues,
+              configDeleteAddresses,
+              maxSizeBytesRejectThreshold,
+              defaultLastValueKey,
+              defaultNonDestructive,
+              defaultExclusiveQueue,
+              defaultGroupRebalance,
+              defaultGroupBuckets,
+              defaultGroupFirstKey,
+              defaultMaxConsumers,
+              defaultPurgeOnNoConsumers,
+              defaultConsumersBeforeDispatch,
+              defaultDelayBeforeDispatch,
+              defaultQueueRoutingType,
+              defaultAddressRoutingType,
+              defaultConsumerWindowSize,
+              defaultRingSize,
+              autoDeleteCreatedQueues,
+              autoDeleteQueuesDelay,
+              autoDeleteQueuesMessageCount,
+              autoDeleteAddressesDelay,
+              redeliveryCollisionAvoidanceFactor,
+              retroactiveMessageCount,
+              autoCreateDeadLetterResources,
+              deadLetterQueuePrefix,
+              deadLetterQueueSuffix,
+              autoCreateExpiryResources,
+              expiryQueuePrefix,
+              expiryQueueSuffix,
+              minExpiryDelay,
+              maxExpiryDelay,
+              enableMetrics);
+
+      AddressSettingsInfo rootInfo = 
AddressSettingsInfo.from(serverControl.getAddressSettingsAsJSON(root));
+
+      // Give settings for addr different values to the root
+      final long addrMinExpiryDelay = rootInfo.getMinExpiryDelay() + 1;
+      final long addrMaxExpiryDelay = rootInfo.getMaxExpiryDelay() - 1;
+      serverControl.addAddressSettings(addr,
+              DLA,
+              expiryAddress,
+              expiryDelay,
+              lastValueQueue,
+              deliveryAttempts,
+              maxSizeBytes,
+              pageSizeBytes,
+              pageMaxCacheSize,
+              redeliveryDelay,
+              redeliveryMultiplier,
+              maxRedeliveryDelay,
+              redistributionDelay,
+              sendToDLAOnNoRoute,
+              addressFullMessagePolicy,
+              slowConsumerThreshold,
+              slowConsumerCheckPeriod,
+              slowConsumerPolicy,
+              autoCreateJmsQueues,
+              autoDeleteJmsQueues,
+              autoCreateJmsTopics,
+              autoDeleteJmsTopics,
+              autoCreateQueues,
+              autoDeleteQueues,
+              autoCreateAddresses,
+              autoDeleteAddresses,
+              configDeleteQueues,
+              configDeleteAddresses,
+              maxSizeBytesRejectThreshold,
+              defaultLastValueKey,
+              defaultNonDestructive,
+              defaultExclusiveQueue,
+              defaultGroupRebalance,
+              defaultGroupBuckets,
+              defaultGroupFirstKey,
+              defaultMaxConsumers,
+              defaultPurgeOnNoConsumers,
+              defaultConsumersBeforeDispatch,
+              defaultDelayBeforeDispatch,
+              defaultQueueRoutingType,
+              defaultAddressRoutingType,
+              defaultConsumerWindowSize,
+              defaultRingSize,
+              autoDeleteCreatedQueues,
+              autoDeleteQueuesDelay,
+              autoDeleteQueuesMessageCount,
+              autoDeleteAddressesDelay,
+              redeliveryCollisionAvoidanceFactor,
+              retroactiveMessageCount,
+              autoCreateDeadLetterResources,
+              deadLetterQueuePrefix,
+              deadLetterQueueSuffix,
+              autoCreateExpiryResources,
+              expiryQueuePrefix,
+              expiryQueueSuffix,
+              addrMinExpiryDelay,
+              addrMaxExpiryDelay,
+              enableMetrics);
+      AddressSettingsInfo addrInfo = 
AddressSettingsInfo.from(serverControl.getAddressSettingsAsJSON(addr));
+
+      assertEquals("settings for addr should carry update", 
addrMinExpiryDelay, addrInfo.getMinExpiryDelay());
+      assertEquals("settings for addr should carry update", 
addrMaxExpiryDelay, addrInfo.getMaxExpiryDelay());
+
+// I noticed if I overwrite the settings with the root settings, then delete, 
a reread produces the expected value.
+//      serverControl.addAddressSettings(addr,

Review comment:
       that actually the workaround I've been using in EnMasse (add the root 
settings, then delete).  I've removed the code now.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 449948)
    Time Spent: 0.5h  (was: 20m)

> Removal of address setting (exact match) ineffective
> ----------------------------------------------------
>
>                 Key: ARTEMIS-2819
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2819
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.13.0
>            Reporter: Keith Wall
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> If, dynamically through management, I add a settings for an address (exact 
> match) then later remove those settings, on re-reading the settings record 
> for the same address, I expect to see the settings from higher in the 
> hierarchy (or the root).  This does not occur.  It behaves as if the removal 
> did not take case.
> I wrote a ActiveMQServerControlTest that demonstrates the problem. Looking at 
> the code, it appears the HierarchicalObjectRepository does not remove its 
> copy from the cache in the exact match case.  Candidate PR raised.
> [https://github.com/apache/activemq-artemis/pull/3199]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to