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_r290967378
##########
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:
> we could (perhaps should) instead of using annotations here (I agree it's
wrong), use a regular property.
You could use an annotation for this if you wanted, although one that wasn't
illegal according to the spec would be my suggestion (I know crazy spec
purists).
> After all when moving the message to DLQ or Expiry we are moving a copy of
the message, and not the original message. (you could see it that way..
although that's one line of argument)
Whether it is copied or not doesn't really come into play here as the
annotation being used is illegal. By supporting this selector feature you are
just adding a finer point to the thing that the broker is doing that it really
shouldn't be. The broker could for instance store the value in an annotation
named 'x-opt-original-destination' or some such and that would be legal. It
would however not be accessible to a client that doesn't have direct access to
annotations but only to application properties.
> Or perhaps we could fix it properly, and use proper annotations. but that
will break compatibility with previous AMQ5, as the message is always converted
from OpenWire into AMQP. (AMQ5 never preserves the AMQP message on that sense)
I'm unclear how ActiveMQ 5 or openwire come into this as 5.x doesn't add the
original destination set on expired and DLQ'd messages when it converts them to
AMQP to the best of my knowledge.
----------------------------------------------------------------
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