Class PubsubBatchOptions
Limits of a batch entry (configuration PubsubBatchEntryMaxEvents,
PubsubBatchEntryMaxBytes): how many of one topic's events of a
PublishEvents call are stored as one stream entry, and how large that entry
may get. Each stream entry costs one sidecar round trip (some milliseconds)
whatever it holds, so the events per entry are what bounds a publisher's
throughput. The byte limit keeps an entry below the smallest message limit of the
supported backends (NATS JetStream: 1 MiB by default).
public sealed record PubsubBatchOptions : IEquatable<PubsubBatchOptions>
- Inheritance
-
PubsubBatchOptions
- Implements
- Inherited Members
Constructors
PubsubBatchOptions(int, int)
Limits of a batch entry (configuration PubsubBatchEntryMaxEvents,
PubsubBatchEntryMaxBytes): how many of one topic's events of a
PublishEvents call are stored as one stream entry, and how large that entry
may get. Each stream entry costs one sidecar round trip (some milliseconds)
whatever it holds, so the events per entry are what bounds a publisher's
throughput. The byte limit keeps an entry below the smallest message limit of the
supported backends (NATS JetStream: 1 MiB by default).
public PubsubBatchOptions(int MaxEvents = 1000, int MaxBytes = 786432)
Parameters
Fields
DefaultMaxBytes
768 KiB: below NATS JetStream's default 1 MiB message limit with room for the entry's own framing.
public const int DefaultMaxBytes = 786432
Field Value
DefaultMaxEvents
As many as a PublishEvents call accepts: one topic's events of a call fit one entry.
public const int DefaultMaxEvents = 1000
Field Value
Off
One event per entry: batch entries are never written (they are still read).
public static readonly PubsubBatchOptions Off
Field Value
Properties
MaxBytes
public int MaxBytes { get; init; }
Property Value
MaxEvents
public int MaxEvents { get; init; }
Property Value
Methods
From(string?, string?)
From configuration; an unset, unparsable or non-positive value keeps the default.
public static PubsubBatchOptions From(string? maxEvents, string? maxBytes)