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 e46545c5c6..4246f7b4fe 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 @@ -163,14 +163,17 @@ public class FilterImpl implements Filter { String amqpNativeID = msg.getStringProperty(NATIVE_MESSAGE_ID); if (amqpNativeID != null) { return SimpleString.of(amqpNativeID); + } else { + return null; } - } - // It's the stringified (hex) representation of a user id that can be used in a selector expression - String userID = msg.getUserID().toString(); - if (userID.startsWith("ID:")) { - return SimpleString.of(userID); } else { - return SimpleString.of("ID:" + msg.getUserID()); + // It's the stringified (hex) representation of a user id that can be used in a selector expression + String userID = msg.getUserID().toString(); + if (userID.startsWith("ID:")) { + return SimpleString.of(userID); + } else { + return SimpleString.of("ID:" + msg.getUserID()); + } } } else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName)) { return (int) msg.getPriority();