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

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

                Author: ASF GitHub Bot
            Created on: 29/Nov/24 10:23
            Start Date: 29/Nov/24 10:23
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on code in PR #5220:
URL: https://github.com/apache/activemq-artemis/pull/5220#discussion_r1863299369


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java:
##########
@@ -543,6 +602,17 @@ public void preAcknowledge(final Transaction tx, final 
MessageReference ref, fin
          logger.trace("preAcknowledge::tx={}, ref={}, reason={}", tx, ref, 
reason);
       }
 
+      SimpleString noForwardSource = null;
+      if 
(Boolean.TRUE.equals(ref.getMessage().getBooleanProperty(INTERNAL_NO_FORWARD))) 
{
+         noForwardSource = (SimpleString) 
ref.getMessage().getBrokerProperty(INTERNAL_NO_FORWARD_SOURCE);

Review Comment:
   Seems to be the fault of setBrokerProperty() using TypedProperties for 
'extra properties' (as well as setting a message annotation if AMQP message), 
which converts a String value to a SimpleString :/
   
   I'd check the exact behaviour first, but I'd be inclined to flip the 
behaviour so it checks with a String instead, i.e that it null checks then does 
String.valueOf to get a String for the comparison. That way its not creating 
new SimpleString from the [typically same] remoteMirrorId value for every 
message checked, but instead just getting the String from the SimpleString 
(that likely already exists because it was  created from a String).





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

    Worklog Id:     (was: 946130)
    Time Spent: 5.5h  (was: 5h 20m)

> AMQ Broker Mirroring: One to Many - avoid the infinite loop of the messages
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5037
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5037
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Thomas Lavocat
>            Assignee: Thomas Lavocat
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> AMQ Broker Mirroring: One to Many - avoid the infinite loop of the messages:
> if we have a->b-c->a..
> a message will circulate forever in the mirrors



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to