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/03/21 10:06:53 UTC

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

PiotrKlimczak commented on a change in pull request #3017: ARTEMIS-2649 refactor ORIG message props
URL: https://github.com/apache/activemq-artemis/pull/3017#discussion_r395979696
 
 

 ##########
 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) {
 
 Review comment:
   The code suggests, that setBreadcrumb might happen for Message.HDR_ORIGINAL_QUEUE but not for Message.HDR_ORIGINAL_ADDRESS and Message.HDR_ORIG_MESSAGE_ID if for example originalID is null.
   As mentioned in past, I am no expert in Artemis therefore I cannot judge if such situation would ever happen, however by analysing this code only, there is a chance that breadcrumbs will run out of sync, as they are set under two separate conditions.
   Will that be a problem however?

----------------------------------------------------------------
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


With regards,
Apache Git Services