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

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

                Author: ASF GitHub Bot
            Created on: 30/Jun/21 23:55
            Start Date: 30/Jun/21 23:55
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on a change in pull request 
#3633:
URL: https://github.com/apache/activemq-artemis/pull/3633#discussion_r661882457



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java
##########
@@ -202,8 +241,35 @@ private static Properties getProperties(Message message) {
 
    @Override
    public void postAcknowledge(MessageReference ref, AckReason reason) throws 
Exception {
+
+      MirrorController targetController = getControllerTarget();
+
+      if (targetController != null || ref.getQueue() != null && 
(ref.getQueue().isInternalQueue() || ref.getQueue().isMirrorController())) {
+         if (logger.isTraceEnabled()) {
+            logger.trace(server + " rejecting postAcknowledge queue=" + 
ref.getQueue().getName() + ", ref=" + ref + " to avoid infinite loop with the 
mirror (reflection)");
+         }
+         return;
+      }
+
+      if (logger.isTraceEnabled()) {
+         logger.trace(server + " postAcknowledge " + ref);
+      }
+
       if (acks && !ref.getQueue().isMirrorController()) { // we don't call 
postACK on snfqueues, otherwise we would get infinite loop because of this 
feedback
-         Message message = createMessage(ref.getQueue().getAddress(), 
ref.getQueue().getName(), POST_ACK, ref.getMessage().getMessageID());
+         Long internalIDObject = 
(Long)ref.getMessage().getBrokerProperty(INTERNAL_ID_EXTRA_PROPERTY);
+         long internalID;
+         if (internalIDObject == null) {
+            internalID = ByteUtil.mixByteAndLong(localMirrorId, 
ref.getMessageID());
+         } else {
+            internalID = internalIDObject.longValue();
+            if (logger.isTraceEnabled()) {
+               logger.trace("server " + server + " acking message " + ref);
+            }
+         }
+         if (logger.isTraceEnabled()) {
+            logger.trace(server + " sending ack message from server " + 
ByteUtil.getFirstByte(internalID) + " with messageID=" + 
ByteUtil.removeFirstByte(internalID));
+         }

Review comment:
       I sent a commit as an attempt to remove the mirrorID and just use 
another value with the node UUID. it will be another Object and another list, 
but it will work.
   
   right now things are not 100% working as I'm getting some reflection on the 
test cases (sends happening again after the mirror is sent).. I will fix this 
tomorrow... 
   
   the last commit still a WIP and a lot of that will still change.. I sent to 
the PR just a reference of my attempt.




-- 
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: 617349)
    Time Spent: 8h 10m  (was: 8h)

> Enhance AMQP Mirror support with dual mirror
> --------------------------------------------
>
>                 Key: ARTEMIS-3243
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3243
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.17.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.18.0
>
>          Time Spent: 8h 10m
>  Remaining Estimate: 0h
>
> at the current Mirror version, we can only mirror into a single direction.
> With this enhancement the two (or more brokers) would be connected to each 
> other, each one having its own ID, and each one would send updates to the 
> other broker.
> The outcome is that if you just transferred producers and consumers from one 
> broker into the other, the fallback would be automatic and simple. No need to 
> disable and enable mirror options.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to