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 subversion and git services (Jira)" <ji...@apache.org> on 2026/10/19 20:06:00 UTC
[jira] [Commented] (ARTEMIS-6308) Core federation: an address-policy's max-hops and a stream's share-connection are never read from broker.xml
[ https://issues.apache.org/jira/browse/ARTEMIS-6308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128885#comment-18128885 ]
ASF subversion and git services commented on ARTEMIS-6308:
----------------------------------------------------------
Commit a71654df89b844ea9fb380f0f73bd37770f048b0 in artemis's branch refs/heads/main from grepjava
[ https://gitbox.apache.org/repos/asf?p=artemis.git;h=a71654df89 ]
ARTEMIS-6308 Core federation ignores max-hops and share-connection from broker.xml
> Core federation: an address-policy's max-hops and a stream's share-connection are never read from broker.xml
> ------------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-6308
> URL: https://issues.apache.org/jira/browse/ARTEMIS-6308
> Project: Artemis
> Issue Type: Bug
> Components: Federation
> Affects Versions: 2.57.0
> Reporter: Jayakumarindran Thanakodi
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{FileConfigurationParser.getAddressPolicy}} reads the hops from an attribute named {{max-consumers}} (FileConfigurationParser.java:2900):
> {code:java}
> if (item.getNodeName().equals("max-consumers")) {
> config.setMaxHops(MINUS_ONE_OR_GE_ZERO.validate(item.getNodeName(), Integer.parseInt(item.getNodeValue())).intValue());
> }
> {code}
> The schema declares {{max-hops}} on {{addressPolicyType}} (artemis-configuration.xsd:1906), and has no {{max-consumers}} there. So {{max-hops}} is accepted and ignored, and {{max-consumers}} fails schema validation, which {{artemis run}} treats as fatal. As a result, an address policy from broker.xml always has {{maxHops = 0}}: its remote queues get the filter {{_AMQ_Hops IS NULL OR _AMQ_Hops<0}}, so a message that has crossed one federation is never federated again, whatever {{max-hops}} says.
> In the same way, {{getFederationStream}} (FileConfigurationParser.java:2958) never reads the {{share-connection}} element that {{streamType}} declares (artemis-configuration.xsd:1735). A downstream therefore never shares an upstream's connection.
> Fix: read {{max-hops}} in {{getAddressPolicy}}, and {{share-connection}} in {{getFederationStream}} ({{config.getConnectionConfiguration().setShareConnection(getBoolean(upstreamNode, "share-connection", false))}}).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org