Package com.eventstore.dbclient
Class NamedConsumerStrategy
java.lang.Object
com.eventstore.dbclient.NamedConsumerStrategy
Named consumer strategies for use with persistent subscriptions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamedConsumerStrategyDistributes events to a single client until the buffer size is reached.static final NamedConsumerStrategyFor use with an indexing projection such as the system $by_category projection.static final NamedConsumerStrategyDistributes events to all client evenly. -
Method Summary
-
Field Details
-
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
Distributes events to all client evenly. If the client buffer-size is reached, the client is ignored until events are (not) acknowledged. -
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 Details
-
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
Checks if the strategy's name matches the string passed as a parameter. -
toString
-