You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:50:00 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3017: ARTEMIS-2649 refactor ORIG message props

clebertsuconic commented on a change in pull request #3017:
URL: https://github.com/apache/activemq-artemis/pull/3017#discussion_r430822358



##########
File path: artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
##########
@@ -463,30 +463,40 @@ default void reencode() {
    }
 
    default void referenceOriginalMessage(final Message original, String originalQueue) {
-      String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
+      String originalQueueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
 
-      if (queueOnMessage != null) {
-         setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
-      } else if (originalQueue != null) {
-         setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
+      if (originalQueueOnMessage != null) {
+         setBreadcrumb(Message.HDR_ORIGINAL_QUEUE, originalQueueOnMessage);
       }
 
+      setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
+
       Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
 
       if (originalID != null) {
-         setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
-
-         setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
-      } else {
-         setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
+         setBreadcrumb(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
 
-         setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
+         setBreadcrumb(Message.HDR_ORIG_MESSAGE_ID, originalID);
       }
 
+      setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
+
+      setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());

Review comment:
       you probably want to call setBrokerProperty 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.

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