Class NamedConsumerStrategy


  • public class NamedConsumerStrategy
    extends java.lang.Object
    Named consumer strategies for use with persistent subscriptions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isDispatchToSingle()
      Checks if it's a DispatchToSingle strategy.
      boolean isNamed​(java.lang.String named)
      Checks if the strategy's name matches the string passed as a parameter.
      boolean isPinned()
      Checks if it's a Pinned strategy.
      boolean isRoundRobin()
      Checks if it's a RoundRobin strategy.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DISPATCH_TO_SINGLE

        public static final NamedConsumerStrategy DISPATCH_TO_SINGLE
        Distributes events to a single client until the buffer size is reached. After which the next client is selected in a round-robin style, and the process is repeated.
      • ROUND_ROBIN

        public static final NamedConsumerStrategy ROUND_ROBIN
        Distributes events to all client evenly. If the client buffer-size is reached, the client is ignored until events are (not) acknowledged.
      • PINNED

        public static final NamedConsumerStrategy PINNED
        For use with an indexing projection such as the system $by_category projection. EventStoreDB inspects event for its source stream id, hashing the id to one of 1024 buckets assigned to individual clients. When a client disconnects, its buckets are assigned to other clients. When a client connects, it is assigned some existing buckets. This naively attempts to maintain a balanced workload. The main goal of this strategy is to decrease the likelihood of concurrency and ordering issues while maintaining load balancing. This not a guarantee, and you should handle the usual ordering and concurrency issues.
    • Method Detail

      • isDispatchToSingle

        public boolean isDispatchToSingle()
        Checks if it's a DispatchToSingle strategy.
      • isRoundRobin

        public boolean isRoundRobin()
        Checks if it's a RoundRobin strategy.
      • isPinned

        public boolean isPinned()
        Checks if it's a Pinned strategy.
      • isNamed

        public boolean isNamed​(java.lang.String named)
        Checks if the strategy's name matches the string passed as a parameter.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object