[ 
https://issues.apache.org/jira/browse/ARTEMIS-4455?focusedWorklogId=884607&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-884607
 ]

ASF GitHub Bot logged work on ARTEMIS-4455:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Oct/23 19:37
            Start Date: 11/Oct/23 19:37
    Worklog Time Spent: 10m 
      Work Description: AntonRoskvist commented on PR #4644:
URL: 
https://github.com/apache/activemq-artemis/pull/4644#issuecomment-1758409447

   Hi @clebertsuconic 
   
   No, there should be no semantic change with regards to initial distribution. 
Not as far as I've been able to tell at least. Messages still arrive at the 
local node first, as is expected with OFF_WITH_REDISTRIBUTION. 
   
   For this LB-type, the matchBinding()-method only returns true for the local 
binding which then sets the `lastLowPriorityBinding` to its position.
   
   During the "secondary level of routing logic" the local binding is picked as 
the destination of the message.
   This works as intended and all messages are sent to the local binding.
   Since this is the only outcome of `getNextBinding` though, it means that the 
next step:
   `nextPosition = moveNextPosition(lastLowPriorityBinding, bindingsCount);`
   will always set nextPosition to the same value (provided the topology does 
not change)
   
   After that the `bindingIndex` is set to `nextPosition` i.e set to the same 
value after every incoming message.
   
   The bindingIndex in turn, is used by the redistributor 
(org.apache.activemq.artemis.core.postoffice.impl.BindingsImpl#redistribute()) 
to set the starting point of it's iteration over the bindings to find a 
suitable target, meaning that for a continuous stream of incoming messages, the 
redistributor will pick the same remote Binding as target most of the time, 
leading to an uneven redistribution of messages.
   
   To be clear though, this is my conclusion after poking at this for some 
time, I might have missed something for sure.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 884607)
    Time Spent: 40m  (was: 0.5h)

> Improve message redistribution balance for OFF_WITH_REDISTRIBUTION
> ------------------------------------------------------------------
>
>                 Key: ARTEMIS-4455
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4455
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Anton Roskvist
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> This benefits the case where messages arrive on a clustered node without a 
> local consumer but with multiple remote targets.



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

Reply via email to