You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Matt Pavlovich (Jira)" <ji...@apache.org> on 2023/02/20 15:26:00 UTC

[jira] [Comment Edited] (AMQ-9200) Multiple plugins elements are allowed by config schema but are not supported

    [ https://issues.apache.org/jira/browse/AMQ-9200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17691223#comment-17691223 ] 

Matt Pavlovich edited comment on AMQ-9200 at 2/20/23 3:25 PM:
--------------------------------------------------------------

I think this is a case of the xsd auto-generation being careful. For sure, we don't want to support multiple '<plugins ../>' elements. 

edit: This appears to be a wrapped list issue.. the brokerService setters that take arrays get set to 'unbounded' vs knowing we are looking for a wrapped list.

Single instance parameters get maxOccurs="1"
{noformat}
<xs:element name="adminView" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="brokerContext" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="brokerObjectName" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="consumerSystemUsage" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="dataDirectoryFile" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="destinationFactory" minOccurs="0" maxOccurs="1">
</xs:element>


{noformat}

Multi-instance are gettings maxOccurs="unbounded" vs maxOccurs="1" and understanding its a wrapped list.
{noformat}
<xs:element name="destinationInterceptors" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="destinationPolicy" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="destinations" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="ioExceptionHandler" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="jmsBridgeConnectors" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="jobSchedulerStore" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="managementContext" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="messageAuthorizationPolicy" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="networkConnectorURIs" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="networkConnectors" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="persistenceAdapter" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="persistenceFactory" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="persistenceTaskRunnerFactory" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="plugins" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="producerSystemUsage" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="proxyConnectors" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="regionBroker" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="schedulerDirectoryFile" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="services" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="shutdownHooks" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="sslContext" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="startException" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="systemUsage" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="taskRunnerFactory" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="tempDataStore" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="tmpDataDirectory" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="transportConnectorURIs" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="transportConnectors" minOccurs="0" maxOccurs="unbounded">
</xs:element>
{noformat}


was (Author: mattrpav):
I think this is a case of the xsd auto-generation being careful. For sure, we don't want to support multiple '<plugins ../>' elements. 



> Multiple plugins elements are allowed by config schema but are not supported
> ----------------------------------------------------------------------------
>
>                 Key: AMQ-9200
>                 URL: https://issues.apache.org/jira/browse/AMQ-9200
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>            Reporter: Yury Gubernatorov
>            Assignee: Jean-Baptiste Onofré
>            Priority: Blocker
>             Fix For: 5.18.0, 5.17.4
>
>
> Configuration schema (http://activemq.apache.org/schema/core/activemq-core-5.17.2.xsd for instance) allows multiple "plugins" elements:
> <xs:element name='plugins' minOccurs='0' maxOccurs='unbounded'>
> But only the last element is taken into account.
> So if user by mistake ends up with multiple plugins elements in their config it can come as surprise to them that plugins were not configured properly.
> This can become critical for some users as, for example, authorization comes as a plugin and user does not know if it is working or not unless they perform a negative test.
> I recently saw real-life configs looking like this:
> <broker>
> ...
>   <plugins>
>     <authorizationPlugin>...</authorizationPlugin>
>     <forcePersistencyModeBrokerPlugin persistenceFlag="true"/>
>   </plugins>
> ...
>   <plugins/>
> </broker>
> The broker would run, but authorization plugin will not work allowing anyone with the network access to connect without providing credentials. Persistency is not forced as well.
> We should set maxOccurs="1" on the plugins element probably.



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