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

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

                Author: ASF GitHub Bot
            Created on: 20/Jan/23 14:01
            Start Date: 20/Jan/23 14:01
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4338:
URL: https://github.com/apache/activemq-artemis/pull/4338#discussion_r1082573823


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java:
##########
@@ -239,37 +249,107 @@ public void sendMessage(Message message, RoutingContext 
context, List<MessageRef
       try {
          context.setReusable(false);
 
-         MessageReference ref = 
MessageReference.Factory.createReference(message, snfQueue);
-         String nodeID = setProtocolData(idSupplier, ref);
+         String nodeID = idSupplier.getServerID(message);
+
          if (nodeID != null && nodeID.equals(getRemoteMirrorId())) {
             logger.trace("Message {} already belonged to the node, {}, it 
won't circle send", message, getRemoteMirrorId());
             return;
          }
+
+         MessageReference ref = 
MessageReference.Factory.createReference(message, snfQueue);
+         setProtocolData(ref, nodeID, idSupplier.getID(ref));
+
          snfQueue.refUp(ref);
+         List<MessageReference> refs;
+
+         if (tx != null) {
+            if (logger.isDebugEnabled()) {
+               logger.debug("Mirroring Message " + message + " with TX");
+            }
+            MirrorSendOperation mirrorSendOperation = getSendOperation(tx);
+            refs = mirrorSendOperation.mirroredRefs;
+         } else {
+            refs = new LinkedList<>();

Review Comment:
   actually, I will just use the ref directly.. thanks a lot!





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

    Worklog Id:     (was: 840639)
    Time Spent: 1h 10m  (was: 1h)

> Mirror sync replication
> -----------------------
>
>                 Key: ARTEMIS-4136
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4136
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.28.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> I'm adding an option sync=true|false on mirror.
> It will be possible to configure a mirror as this:
>      <broker-connections>
>          <amqp-connection uri="tcp://test1:111" name="test1" 
> retry-interval="333" reconnect-attempts="33" user="testuser" 
> password="testpassword">
>             <mirror sync="true"/>
>        </amqp-connection
>    </broker-connection>
> if sync is set to true, any client blocking operation would wait a mirror 
> callback.
> With that option set, any blocking operation on the broker will wait a mirror 
> roundtrip:
> tx.commit(), session.send (non transactional). client.ack (when configured as 
> sync).
> Notice that in AMQP client dispositions are always asynchronous, hence it's 
> only possible to sync acks if using transactional for AMQP.



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

Reply via email to