From bed73f57b37ee8d2a53a4e4b28d3f5e983b988cd Mon Sep 17 00:00:00 2001 From: Martyn Taylor Date: Wed, 20 Jul 2016 13:21:53 +0100 Subject: [PATCH] ARTEMIS-641 Enable filtering on address in server consumer --- .../apache/activemq/artemis/api/core/FilterConstants.java | 6 ++++++ .../activemq/artemis/core/filter/impl/FilterImpl.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java index 0fbd35f6f8..27aa9b4889 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java @@ -62,11 +62,17 @@ public final class FilterConstants { */ public static final SimpleString ACTIVEMQ_SIZE = new SimpleString("AMQSize"); + /** + * Name of the ActiveMQ Artemis Address header + */ + public static final SimpleString ACTIVEMQ_ADDRESS = new SimpleString("AMQAddress"); + /** * All ActiveMQ Artemis headers are prepended by this prefix. */ public static final SimpleString ACTIVEMQ_PREFIX = new SimpleString("AMQ"); + private FilterConstants() { // Utility class } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java index 77bf7c5eb8..f807a183d1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java @@ -169,6 +169,9 @@ public class FilterImpl implements Filter { else if (FilterConstants.ACTIVEMQ_SIZE.equals(fieldName)) { return msg.getEncodeSize(); } + else if (FilterConstants.ACTIVEMQ_ADDRESS.equals(fieldName)) { + return msg.getAddress(); + } else { return null; }