Class KeyedThrottleDefinition

Assembly: redb.Route.dll

Scope-opener definition for the keyed (per-key) Throttle EIP.
Limits the rate at which each unique key can enter the downstream pipeline.
Inherits the leaf DSL from .
Close with .

public class KeyedThrottleDefinition : RouteDefinitionBase<KeyedThrottleDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope

Inheritance

Implements

Inherited Members

Properties

KeyExtractor

Gets the key extractor function.

public Func<IExchange, string> KeyExtractor { get; }

MaxPerPeriod

Gets the max exchanges per period per key.

public int MaxPerPeriod { get; }

MaxPerPeriodFactory

Limit per key evaluated on each message (key and limit come from the message:

public Func<IExchange, int> MaxPerPeriodFactory { get; }

Period

Gets the time period for the rate limit (null = 1 second default).

public TimeSpan? Period { get; }

Methods

CreateProcessor(IRouteContext)

Compile this node into a runtime processor.

public override IProcessor CreateProcessor(IRouteContext context)

End()

Closes this scope and returns the parent .

public IRouteDefinition End()

EndKeyedThrottle()

Closes the KeyedThrottle scope and returns the parent route definition.

public IRouteDefinition EndKeyedThrottle()

RejectOnOverflow(bool)

Opt into RFC 6585 §4 rejection semantics: overflow exchanges are short-circuited with

public KeyedThrottleDefinition RejectOnOverflow(bool reject = true)