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

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

                Author: ASF GitHub Bot
            Created on: 28/Sep/23 13:39
            Start Date: 28/Sep/23 13:39
    Worklog Time Spent: 10m 
      Work Description: gtully commented on code in PR #4634:
URL: https://github.com/apache/activemq-artemis/pull/4634#discussion_r1340173331


##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java:
##########
@@ -2057,6 +2061,57 @@ public void testStatusOnErrorApplyingProperties() throws 
Exception {
       assertTrue(jsonStatus.contains("alder32"));
    }
 
+   @Test
+   public void testPlugin() throws Exception {
+
+      final ConfigurationImpl configuration = new ConfigurationImpl();
+
+      Properties insertionOrderedProperties = new 
ConfigurationImpl.InsertionOrderedProperties();
+
+      
insertionOrderedProperties.put("brokerPlugins.\"org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin.class\".init",
 "LOG_ALL_EVENTS=true,LOG_SESSION_EVENTS=false");
+
+      configuration.parsePrefixedProperties(insertionOrderedProperties, null);
+
+      Assert.assertEquals(1, configuration.getBrokerPlugins().size());
+      
Assert.assertTrue(((LoggingActiveMQServerPlugin)(configuration.getBrokerPlugins().get(0))).isLogAll());
+      
Assert.assertFalse(((LoggingActiveMQServerPlugin)(configuration.getBrokerPlugins().get(0))).isLogSessionEvents());
+      
Assert.assertTrue(configuration.getBrokerPlugins().get(0).getName().contains(DOT_CLASS));
+
+      // serer initialisePart1
+      configuration.registerBrokerPlugins(configuration.getBrokerPlugins());
+
+      Assert.assertEquals(1, configuration.getBrokerPlugins().size());
+      Assert.assertEquals(1, configuration.getBrokerMessagePlugins().size());
+      Assert.assertEquals(1, 
configuration.getBrokerConnectionPlugins().size());
+
+      insertionOrderedProperties = new 
ConfigurationImpl.InsertionOrderedProperties();
+
+      // possible to change any attribute, but plugins only registered on start

Review Comment:
   I think this is invalid, on reload, a new configuration impl will be 
created. And the pattern on a plugin is a single call to init, which is one 
line of properties config





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

    Worklog Id:     (was: 882435)
    Time Spent: 1h  (was: 50m)

> properties config - support broker plugin - logging broker plugin
> -----------------------------------------------------------------
>
>                 Key: ARTEMIS-4443
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4443
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker, Configuration
>    Affects Versions: 2.31.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.32.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> broker plugins require a way to add a new instance of a class to a collection 
> via broker properties. Using the class name as the key can work nicely.
> In addition, the registration and configuration of broker plugins needs to be 
> separated, currently they are handled in a single method call.
> {code}    
> brokerPlugins.\"org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin.class\".init=LOG_ALL_EVENTS=false
> {code}



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

Reply via email to