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

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

                Author: ASF GitHub Bot
            Created on: 22/Nov/21 14:58
            Start Date: 22/Nov/21 14:58
    Worklog Time Spent: 10m 
      Work Description: AntonRoskvist commented on a change in pull request 
#3858:
URL: https://github.com/apache/activemq-artemis/pull/3858#discussion_r754357267



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
##########
@@ -315,6 +315,37 @@ public void onNotification(final Notification 
notification) {
 
                queueInfos.put(clusterName, info);
 
+               if (distance < 1) {
+                  //Binding added locally. If a matching remote binding with 
consumers exist, add a redistributor
+                  Binding binding = getBinding(routingName);
+
+                  if (binding != null) {
+                     try {
+                        Bindings bindings = getBindingsForAddress(address);
+
+                        for (Binding bind : bindings.getBindings()) {
+                           if (bind.isConnected() && bind instanceof 
RemoteQueueBinding) {
+
+                              RemoteQueueBinding remoteBinding = 
(RemoteQueueBinding) bind;
+
+                              if (remoteBinding.consumerCount() > 0) {
+
+                                 Queue queue = (Queue) binding.getBindable();
+                                 AddressSettings addressSettings = 
addressSettingsRepository.getMatch(binding.getAddress().toString());
+                                 long redistributionDelay = 
addressSettings.getRedistributionDelay();
+
+                                 if (redistributionDelay != -1) {
+                                    
queue.addRedistributor(redistributionDelay);

Review comment:
       I left a comment below about this, see if you agree, otherwise I will 
look into adding some form of delay here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 684775)
    Time Spent: 1h 50m  (was: 1h 40m)

> ARTEMIS-1925 fix does not handle redistribution to "old" consumers
> ------------------------------------------------------------------
>
>                 Key: ARTEMIS-3557
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3557
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Anton Roskvist
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> OFF_WITH_REDISTRIBUTION does not handle this scenario:
> If a destination and consumer exist on one node in a cluster and a producer 
> shows up on another node messages will not get redistributed until the old 
> consumer disconnects and reconnects.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to