You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/10/22 21:51:00 UTC
[jira] [Work logged] (ARTEMIS-6318) ConnectionPeriodicExpiryPlugin configured in broker-plugins, as the manual shows, stops the broker: the parser requires an ActiveMQServerPlugin
[ https://issues.apache.org/jira/browse/ARTEMIS-6318?focusedWorklogId=1049453&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1049453 ]
ASF GitHub Bot logged work on ARTEMIS-6318:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Oct/26 21:50
Start Date: 22/Oct/26 21:50
Worklog Time Spent: 10m
Work Description: grepjava opened a new pull request, #6822:
URL: https://github.com/apache/artemis/pull/6822
The manual configures `ConnectionPeriodicExpiryPlugin` in `<broker-plugins>`, but the broker then fails to start: `FileConfigurationParser` loads every `<broker-plugin>` class as an `ActiveMQServerPlugin`, and `ConnectionPeriodicExpiryPlugin` implements only `ActiveMQServerBasePlugin`, so `ClassloadingUtil` throws `IllegalStateException: ... is not assignable from expected type: interface ...ActiveMQServerPlugin`.
The parser now loads `<broker-plugin>` classes as `ActiveMQServerBasePlugin`, the type `Configuration.registerBrokerPlugin` takes and the one broker properties already use, and `registerBrokerPlugin` sorts each plugin by the interfaces it implements as before.
`FileConfigurationTest.testBrokerPlugin` now also parses the manual's `ConnectionPeriodicExpiryPlugin` element and checks its `acceptorMatchRegex`. It fails without the fix.
https://issues.apache.org/jira/browse/ARTEMIS-6318
Issue Time Tracking
-------------------
Worklog Id: (was: 1049453)
Remaining Estimate: 0h
Time Spent: 10m
> ConnectionPeriodicExpiryPlugin configured in broker-plugins, as the manual shows, stops the broker: the parser requires an ActiveMQServerPlugin
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-6318
> URL: https://issues.apache.org/jira/browse/ARTEMIS-6318
> Project: Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.57.0
> Reporter: Jayakumarindran Thanakodi
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The manual (broker-plugins.adoc, "Using the ConnectionPeriodicExpiryPlugin") configures the plugin in {{broker.xml}}:
> {code:xml}
> <broker-plugins>
> <broker-plugin class-name="org.apache.activemq.artemis.core.server.plugin.impl.ConnectionPeriodicExpiryPlugin">
> <property key="acceptorMatchRegex" value="netty-client-acceptor" />
> </broker-plugin>
> </broker-plugins>
> {code}
> {{ConnectionPeriodicExpiryPlugin}} implements {{ActiveMQServerBasePlugin}} only (ConnectionPeriodicExpiryPlugin.java:38). {{FileConfigurationParser.parseActiveMQServerPlugin}} (FileConfigurationParser.java:1064) makes every {{<broker-plugin>}} through {{ClassloadingUtil.newInstanceFromClassLoader(..., ActiveMQServerPlugin.class)}} and casts it to {{ActiveMQServerPlugin}}, so the plugin is refused before {{init}} runs:
> {noformat}
> java.lang.IllegalStateException: clazz [org.apache.activemq.artemis.core.server.plugin.impl.ConnectionPeriodicExpiryPlugin] is not assignable from expected type: interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerPlugin
> {noformat}
> {{Configuration.registerBrokerPlugin}} takes an {{ActiveMQServerBasePlugin}}, and broker properties ({{brokerPlugins."...ConnectionPeriodicExpiryPlugin.class".acceptorMatchRegex=...}}) configure the plugin without trouble; that is the only path the tests take ({{ConfigurationImplTest}}, {{ConnectionPeriodicExpiryPluginTest}}). The XML path the manual documents has no test.
> Steps to reproduce (2.57.0, Windows, JDK 25):
> # {{artemis create}} an instance and add the manual's {{<broker-plugins>}} block above to {{etc/broker.xml}}.
> # {{bin/artemis run}}: the banner, then the {{IllegalStateException}} above, and the broker does not start.
> # {{bin/artemis properties}} on the same instance fails with the same message.
> Suggested fix: have {{parseBrokerPlugins}} load {{<broker-plugin>}} classes as {{ActiveMQServerBasePlugin}} ({{parseActiveMQServerPlugin}} returning an {{ActiveMQServerBasePlugin}}, with {{newInstanceFromClassLoader(..., ActiveMQServerBasePlugin.class)}}) and register them as such; {{registerBrokerPlugin}} already sorts each plugin into the lists of the interfaces it implements. A test: parse the manual's XML and check the plugin is registered with its {{acceptorMatchRegex}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org