Search code examples
jmsactivemq-artemis

Is it possible to remove messages from an ActiveMQ Artemis queue that don't have an attribute?


I'd need to remove messages from a DLQ in ActiveMQ Artemis that don't have an attribute set.

As I understand, the JMX operation removeMessages(string) supports a filter expression, but I'm not sure if it's possible to use something like "attribute is NULL". Is it?


Solution

  • As noted in the ActiveMQ Artemis documentation, the filter expression syntax supported by the broker is the same as the syntax of JMS selectors which is documented here. Regarding selectors, this documentation states:

    If a property that does not exist in a message is referenced, its value is NULL.

    So, you can use a selector like attribute is NULL.