You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/07/01 02:17:00 UTC

[jira] [Work logged] (ARTEMIS-3243) Enhance AMQP Mirror support with dual mirror

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

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

                Author: ASF GitHub Bot
            Created on: 01/Jul/21 02:16
            Start Date: 01/Jul/21 02:16
    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_r661924025



##########
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 actually got the tests fixed.. I will spend some time cleaning up tomorrow.
   
   but the mixed IDs are gone now.




-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

    Worklog Id:     (was: 617376)
    Time Spent: 8h 20m  (was: 8h 10m)

> 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 20m
>  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)