AntonRoskvist commented on a change in pull request #3858:
URL: https://github.com/apache/activemq-artemis/pull/3858#discussion_r754358740



##########
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) {

Review comment:
       Yes, that makes a lot of sense, I will look into that.




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


Reply via email to