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] [Updated] (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?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ARTEMIS-6318:
------------------------------------
    Labels: pull-request-available  (was: )

> 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
>              Labels: pull-request-available
>          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