Class MongoDbTopicSelector

    • Constructor Detail

      • MongoDbTopicSelector

        public MongoDbTopicSelector()
    • Method Detail

      • defaultSelector

        public static TopicSelector<CollectionId> defaultSelector​(String prefix,
                                                                  String heartbeatPrefix)
        Gets the selector for topics for a given prefix, database name, and collection name. This selector returns "<prefix>.<dbName>.<collectionName>", and does not use the replica set name.
        Parameters:
        prefix - the prefix; be null or empty if no prefix is needed
        heartbeatPrefix - the name of the prefix to be used for all heartbeat topics; may not be null and must not terminate in the delimiter
        Returns:
        the topic selector; never null
      • getTopicName

        private static String getTopicName​(CollectionId collectionId,
                                           String prefix,
                                           String delimiter)
        Get the name of the topic for a given prefix, database name, and collection name. This method returns "<prefix><delimiter><dbName><delimiter><collectionName>", and does not use the replica set name.
        Parameters:
        delimiter - the string delineating the prefix, database, and collection names; may not be null
        prefix - the prefix; be null or empty if no prefix is needed
        Returns:
        the topic selector; never null