clebertsuconic commented on code in PR #4734:
URL: https://github.com/apache/activemq-artemis/pull/4734#discussion_r1446811859


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java:
##########
@@ -609,10 +600,22 @@ private Message createMessage(SimpleString address, 
SimpleString queue, Object e
       return 
AMQPMirrorMessageFactory.createMessage(snfQueue.getAddress().toString(), 
address, queue, event, brokerID, body, ackReason);
    }
 
-   public static void route(ActiveMQServer server, Message message) throws 
Exception {
+   public static void routeMirrorCommand(ActiveMQServer server, Message 
message) throws Exception {
+      message.setMessageID(server.getStorageManager().generateID());
+      RoutingContext ctx = mirrorControlRouting.get();
+      // it is important to use local only at the source to avoid having the 
message strictly load balancing
+      // to other nodes if the SNF queue has the same name as the one on this 
node.
+      
ctx.clear().setMirrorOption(MirrorOption.disabled).setLoadBalancingType(MessageLoadBalancingType.LOCAL_ONLY);
+      server.getPostOffice().route(message, ctx, false);
+   }

Review Comment:
   thanks for pointing that out.. During my hacking I had a few versions where 
I was using a different route Method. As it stands I missed simplifying at the 
end.. thanks



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