Table of Contents

Class PubsubBatchOptions

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

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

MaxEvents int
MaxBytes int

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

int

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

int

Off

One event per entry: batch entries are never written (they are still read).

public static readonly PubsubBatchOptions Off

Field Value

PubsubBatchOptions

Properties

MaxBytes

public int MaxBytes { get; init; }

Property Value

int

MaxEvents

public int MaxEvents { get; init; }

Property Value

int

Methods

From(string?, string?)

From configuration; an unset, unparsable or non-positive value keeps the default.

public static PubsubBatchOptions From(string? maxEvents, string? maxBytes)

Parameters

maxEvents string
maxBytes string

Returns

PubsubBatchOptions