private MultiValueMap<String, String> filterSubscriptions(
      MultiValueMap<String, String> allMatches, Message<?> message) {

    if (!this.selectorHeaderInUse) {
      return allMatches;
    }
    MultiValueMap<String, String> result = new LinkedMultiValueMap<>(allMatches.size());
    allMatches.forEach((sessionId, subIds) -> {
      subIds.forEach(subId -> {
        SessionSubscriptionInfo info = this.subscriptionRegistry.getSubscriptions(sessionId);
        if (info == null) {
          return;
        }
        Subscription sub = info.getSubscription(subId);
        if (sub == null) {
          return;
        }
        Expression expression = sub.getSelectorExpression();
        if (expression == null) {
          result.add(sessionId, subId);
          return;
        }
        try {
          if (Boolean.TRUE.equals(expression.getValue(messageEvalContext, message, Boolean.class))) {
            result.add(sessionId, subId);
          }
        }
        catch (SpelEvaluationException ex) {
          if (logger.isDebugEnabled()) {
            logger.debug("Failed to evaluate selector: " + ex.getMessage());
          }
        }
        catch (Throwable ex) {
          logger.debug("Failed to evaluate selector", ex);
        }
      });
    });
    return result;
  }
Return the name for the selector header.
@since 4.2
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AmbariSubscriptionRegistry.java