tabish121 commented on a change in pull request #2695: ARTEMIS-2372 Filtering 
on Message Annotations
URL: https://github.com/apache/activemq-artemis/pull/2695#discussion_r290977379
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
 ##########
 @@ -1263,7 +1263,10 @@ public Long getLongProperty(String key) throws 
ActiveMQPropertyConversionExcepti
 
    @Override
    public Object getObjectProperty(String key) {
-      if (key.equals(MessageUtil.TYPE_HEADER_NAME.toString())) {
+
+      if 
(key.startsWith(AMQPMessageSupport.JMS_AMQP_MESSAGE_ANNOTATION_PREFIX)) {
 
 Review comment:
   I can only find one sneaky way to apply a selector that would allow you to 
match on the original destination when a message is in the DLQ when using an 
AMQP consumer with 5.x.  If the user is talking about an OpenWire consumer then 
that is a different thing entirely and you cannot just say the two are 
equivalent.  
   
   Doing something more akin to what 5.x does is probably actually an easier to 
explain solution than the way you've done here as it doesn't involve knowledge 
of message annotations or even protocol for the most part (if tweaked a bit).  
   
   In 5.x as it stands now you can create a consumer using Qpid JMS that is 
subscribed to the DLQ and provide a selector along the lines of 
"JMSDestination='queue://myOriginalQueue'" and that would match if the message 
had expired off the queue "myOriginalQueue".  This works because the property 
expression applied via the selector first checks if the message has an original 
destination stored in it and uses that instead of the current destination to 
match on the selector value.  If Artemis was to do something similarly clever 
then you wouldn't need to require the user to provide some arbitrary value like 
_AMQ_SOMETHING_OR_OTHER their code remains vendor and protocol neutral.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to