public LinkedMultiValueMap<String, String> getSubscriptions(String destination, Message<?> message) {
      LinkedMultiValueMap<String, String> copiedSubscriptions = new LinkedMultiValueMap<>();
      if (notSubscriptionCache.asMap().keySet().contains(destination)) {
        return copiedSubscriptions;
      }
      this.accessCache.compute(destination, (key, value) -> {
        if (value == null) {
          LinkedMultiValueMap<String, String> result = new LinkedMultiValueMap<>();
          subscriptionRegistry.getAllSubscriptions().forEach((info) -> {
            info.getDestinations().forEach((destinationPattern) -> {
              //TODO temporary changed to more fast-acting check without regex, need move investigation
              if (destinationPattern.equals(destination)) {
                info.getSubscriptions(destinationPattern).forEach((subscription) -> {
                  result.add(info.sessionId, subscription.getId());
                });
              }
            });
          });
          if (!result.isEmpty()) {
            copiedSubscriptions.addAll(result.deepCopy());
            return result;
          } else {
            notSubscriptionCache.put(destination, "");
            return null;
          }
        } else {
          copiedSubscriptions.addAll(value.deepCopy());
          return value;
        }
      });
      return copiedSubscriptions;
    }
Map from destination -> <sessionId, subscriptionId> for fast look-ups
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AmbariSubscriptionRegistry.java