[
https://issues.apache.org/jira/browse/ARTEMIS-4818?focusedWorklogId=923860&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-923860
]
ASF GitHub Bot logged work on ARTEMIS-4818:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Jun/24 10:27
Start Date: 18/Jun/24 10:27
Worklog Time Spent: 10m
Work Description: gemmellr commented on code in PR #4979:
URL: https://github.com/apache/activemq-artemis/pull/4979#discussion_r1644220864
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -3489,10 +3498,19 @@ private Object trackCollectionOrMap(String name, Object
resolved, Object bean) {
private Object findByNameProperty(String key, Collection collection)
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException
{
// locate on name property, may be a SimpleString
- for (Object candidate : collection) {
- Object candidateName = getProperty(candidate, "name");
- if (candidateName != null && key.equals(candidateName.toString()))
{
- return candidate;
+ if (isClassProperty(key)) {
Review Comment:
The comment on the line above this should either be adjusted, or move down
toward the code it applied to originally.
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -958,6 +958,15 @@ public <T> T convert(Class<T> type, Object value) {
updateApplyStatus(propsId, errors);
}
+ private static boolean isClassProperty(String property) {
+ return property.endsWith(PROPERTY_CLASS_SUFFIX);
+ }
+
+ private static String extractPropertyClassName(String property) {
+ int propertyClassSuffixIndex = property.indexOf(PROPERTY_CLASS_SUFFIX);
+ return property.substring(0, propertyClassSuffixIndex);
+ }
Review Comment:
These two are a bit inconsistent, in that the first one only checks for
_endsWith_, but the second extracts only up to the _first_ instance found,
which could be different. Would be better if they both operated on the end
basis for consistency (also saves looking for the location index of a value you
can already calculate).
Issue Time Tracking
-------------------
Worklog Id: (was: 923860)
Time Spent: 0.5h (was: 20m)
> Improve support for multiple broker plugins from broker properties
> ------------------------------------------------------------------
>
> Key: ARTEMIS-4818
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4818
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Domenico Francesco Bruscino
> Assignee: Domenico Francesco Bruscino
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The broker support loading multiple broker plugins from the broker properties
> only if they expose a getter/setter for the property name. Could you support
> loading multiple broker plugins without a getter/setter for the property name?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact