Package de.otto.synapse.messagestore
Class Indexers
- java.lang.Object
-
- de.otto.synapse.messagestore.Indexers
-
@Beta public class Indexers extends java.lang.ObjectUtility class used to createIndexerinstances.
-
-
Method Summary
Modifier and Type Method Description static IndexerchannelNameIndexer()Returns an Indexer that is indexingTextMessagebyKey.partitionKey().static Indexercomposite(com.google.common.collect.ImmutableList<Indexer> indexers)Returns a composite Indexer that is able to support several indexes.static Indexercomposite(Indexer... indexers)Returns a composite Indexer that is able to support several indexes.static IndexerjournalKeyIndexer()static IndexernoOpIndexer()static IndexeroriginIndexer(java.lang.String origin)Returns an Indexer that is indexing all entries with static value that is identifying the origin of some message.static IndexerpartitionKeyIndexer()Returns an Indexer that is indexingTextMessagebyKey.partitionKey().static IndexerserviceInstanceIndexer(java.lang.String serviceInstance)Returns an Indexer that is indexing all entries with static value that is identifying the service-instance that has added the message to theMessageStore.
-
-
-
Method Detail
-
noOpIndexer
public static Indexer noOpIndexer()
- Returns:
- no-op Indexer that is not doing anything.
-
composite
public static Indexer composite(com.google.common.collect.ImmutableList<Indexer> indexers)
Returns a composite Indexer that is able to support several indexes.- Parameters:
indexers- the list of Indexers- Returns:
- composite Indexer
-
composite
public static Indexer composite(Indexer... indexers)
Returns a composite Indexer that is able to support several indexes.- Parameters:
indexers- the list of Indexers- Returns:
- composite Indexer
-
originIndexer
public static Indexer originIndexer(@Nonnull java.lang.String origin)
Returns an Indexer that is indexing all entries with static value that is identifying the origin of some message.The origin can be the name of the service sending the message, or some other identifier like, for example 'Snapshot'.
- Parameters:
origin- the origin of the indexed message- Returns:
- origin indexer
-
serviceInstanceIndexer
public static Indexer serviceInstanceIndexer(@Nonnull java.lang.String serviceInstance)
Returns an Indexer that is indexing all entries with static value that is identifying the service-instance that has added the message to theMessageStore.In most cases, a
hostname:portorservice-name@hostname:portvalue is sufficient to identify the instance of some service- Parameters:
serviceInstance- a string identifying a single instance of a cluster.- Returns:
- serviceInstance indexer
-
partitionKeyIndexer
public static Indexer partitionKeyIndexer()
Returns an Indexer that is indexingTextMessagebyKey.partitionKey().- Returns:
- partition-key indexer
-
journalKeyIndexer
public static Indexer journalKeyIndexer()
-
channelNameIndexer
public static Indexer channelNameIndexer()
Returns an Indexer that is indexingTextMessagebyKey.partitionKey().- Returns:
- partition-key indexer
-
-