You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2026/10/12 04:10:00 UTC

[jira] [Assigned] (ARTEMIS-6298) Redistribution fails with selectors and multiple local consumers

     [ https://issues.apache.org/jira/browse/ARTEMIS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Bertram reassigned ARTEMIS-6298:
---------------------------------------

    Assignee: Justin Bertram

> Redistribution fails with selectors and multiple local consumers
> ----------------------------------------------------------------
>
>                 Key: ARTEMIS-6298
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-6298
>             Project: Artemis
>          Issue Type: Bug
>          Components: Clustering
>    Affects Versions: 2.57.0
>            Reporter: Marc Leisi
>            Assignee: Justin Bertram
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Due to our consumer implementation (Spring), it is common at runtime that all consumers with filter A are connected to broker 0, while all consumers with filter B are connected to broker 1.
> Usually this is not a problem: when a message is produced, server-side load balancing forwards it to the broker that has matching consumers.
> However, if initial load balancing does not take place (e.g. because no matching consumer was connected anywhere when the message was produced), redistribution should move the message to the other broker as soon as a matching consumer becomes available there.
> *Environment:*
> Apache Artemis 2.57.0, symmetric cluster with two brokers.
> *Configuration:*
> A single address with one anycast queue:
>  * message-load-balancing = ON_DEMAND ([server-side load balancing|https://artemis.apache.org/components/artemis/documentation/latest/clusters.html#server-side-message-load-balancing])
>  * redistribution-delay = 1000 ms ([message redistribution|https://artemis.apache.org/components/artemis/documentation/latest/clusters.html#message-redistribution]) Consumers on this queue use selectors ([filter expressions|https://artemis.apache.org/components/artemis/documentation/latest/filter-expressions.html#filter-expressions]). 
> *Expected behavior:*
> A message on broker 0 that matches only the selector of a consumer on broker 1 is redistributed to broker 1, regardless of how many non-matching consumers are connected to broker 0.
> *Actual behavior:*
>  * 1 local (non-matching) consumer + 1 remote (matching) consumer: message is redistributed. 
>  * 2 or more local (non-matching) consumers + 1 remote (matching) consumer: message is NOT redistributed and stays on broker 0. 
> *Reproduction:*
> To reproduce the issue, we created [an integration test|https://github.com/leisma/artemis/blob/simulate-stale-message-problem/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/OnDemandRedistributionWithMultipleConsumerAndSelectorsClusterTest.java] that covers the working cases as well as the failing one. The failing scenario is {{testRedistributionManyInitialLocalConsumer}}.



--
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