Class ConcurrencyOption

Namespace: redb.Route.Core
Assembly: redb.Route.dll

One resolver for every consumer-concurrency option that accepts auto. The industry default
for broker consumers is 1 — ordering is preserved and handlers need not be thread-safe (Camel
JMS/SQS, Spring, the Azure SDK all ship 1) — so the default stays 1 and parallelism is an explicit
opt-in: a number, or auto = max(CPU count, 2), the NServiceBus formula.

The option is a string because it accepts the word auto beside a number, which an int
property cannot hold. The string binds verbatim and this resolver fails loud on anything that is
neither a positive integer nor auto.

public static class ConcurrencyOption

Inheritance

Object→ConcurrencyOption

Properties

Auto

The value auto resolves to: max(logical CPU count, 2).

public static int Auto { get; }

Methods

Resolve(string?, string, int)

Resolves a raw option value: null/empty → defaultValue, an integer ≥ 1 →

public static int Resolve(string? raw, string optionName, int defaultValue = 1)