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/10/21 21:01:58 UTC

[GitHub] [activemq-artemis] tabish121 commented on a change in pull request #3294: ARTEMIS-2937 Server Side AMQP Connectivity with options to transfer queue or replicate data

tabish121 commented on a change in pull request #3294:
URL: https://github.com/apache/activemq-artemis/pull/3294#discussion_r509693361



##########
File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
##########
@@ -642,9 +657,17 @@ protected synchronized void scanMessageData() {
             } else if (DeliveryAnnotations.class.equals(constructor.getTypeClass())) {
                // Don't decode these as they are not used by the broker at all and are
                // discarded on send, mark for lazy decode if ever needed.
-               constructor.skipValue();
-               deliveryAnnotationsPosition = constructorPos;
-               encodedDeliveryAnnotationsSize = data.position() - constructorPos;
+               try {
+                  deliveryAnnotationsPosition = constructorPos;
+                  this.deliveryAnnotations = (DeliveryAnnotations) constructor.readValue();
+                  encodedDeliveryAnnotationsSize = data.position() - constructorPos;
+               } catch (Exception e) {
+                  // mal formed delivery annotation, we will just skip it then
+                  logger.debug(e.getMessage(), e);
+                  data.position(constructorPos);
+                  constructor.skipValue();
+                  encodedDeliveryAnnotationsSize = data.position() - constructorPos;
+               }

Review comment:
       This test was originally checking that since the broker didn't ever use any delivery annotations and simply trimmed them that it didn't bother to try and decode and validate them  Since you are actually using them in this new feature it probably means you can now remove this test and react accordingly to delivery annotations that have encoding issues vs just trimming them out. 




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