Table of Contents

Class PubsubDeliveryOptions

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

How the gateway serves a subscriber that is behind (TopicDaprSubscriptionRegistry). Delivery never waits for it and never drops its events: it is served from the topic's stream at its own pace and rejoins live delivery when it has caught up.

public sealed record PubsubDeliveryOptions : IEquatable<PubsubDeliveryOptions>
Inheritance
PubsubDeliveryOptions
Implements
Inherited Members

Constructors

PubsubDeliveryOptions(TimeSpan)

How the gateway serves a subscriber that is behind (TopicDaprSubscriptionRegistry). Delivery never waits for it and never drops its events: it is served from the topic's stream at its own pace and rejoins live delivery when it has caught up.

public PubsubDeliveryOptions(TimeSpan Stall)

Parameters

Stall TimeSpan

How long a subscriber whose buffer is full may take nothing before its call ends with RESOURCE_EXHAUSTED (configuration PubsubSubscriberStallSeconds, default DefaultStallSeconds). It only clears away clients that are gone or stuck: a subscriber that keeps taking events, however slowly, is never ended, and one that waits costs a buffer and an idle reader, nothing on the topic. Generous therefore; a consumer that stalls for longer than the stream retains (streamTTL) has a gap anyway.

Fields

Default

public static readonly PubsubDeliveryOptions Default

Field Value

PubsubDeliveryOptions

DefaultStallSeconds

public const int DefaultStallSeconds = 300

Field Value

int

Properties

FirstPageEntries

Entries of a subscriber's first catch-up read, before their size is known.

public int FirstPageEntries { get; init; }

Property Value

int

HandledEntries

Entries a topic remembers as handled, to recognize a batch entry the backend delivers again and, for a subscriber that is behind, what live delivery already gave it. Only entries still pending in the sidecar matter, and the sidecar holds at most its queue (Dapr's Redis queueDepth, 100) plus its workers (concurrency, 10) pending: several times that.

public int HandledEntries { get; init; }

Property Value

int

MaxPageEntries

Most entries per catch-up read, however small they are. The size of the entries to come is only known from those read last, so this times the largest entry (DefaultMaxBytes) is the most a read can return, when batch entries follow small events: 96 MiB.

public int MaxPageEntries { get; init; }

Property Value

int

MaxPending

Pending entries read in one look at the consumer group. The sidecar keeps about its queue plus its workers pending (see HandledEntries); a group with more than this has a backlog of its own, and the subscriber's call ends with RESOURCE_EXHAUSTED rather than be served from a picture that is not whole.

public int MaxPending { get; init; }

Property Value

int

PageBytes

Payload bytes a catch-up read aims for. The entries per read follow from the size of those just read, so single small events come by the hundreds and batch entries (up to DefaultMaxBytes each) a few at a time: what one subscriber that is behind holds in memory.

public int PageBytes { get; init; }

Property Value

int

PositionTimeout

How long the topic's delivery may be held for one look at the consumer group (a subscriber falling behind, or rejoining live delivery): two or three Redis round trips, normally a millisecond. Past it the subscriber's call ends (falling behind) or it stays on the stream (rejoining), so a slow Redis never holds a topic's delivery for longer.

public TimeSpan PositionTimeout { get; init; }

Property Value

TimeSpan

SkipLifetime

How long a subscriber back on live delivery skips the entries its catch-up already gave it. Live delivery brings them within the sidecar's redelivery (Dapr's processingTimeout 60 s plus redeliverInterval 15 s here) or never; past this a skip is forgotten, so a later event that reuses the id is delivered.

public TimeSpan SkipLifetime { get; init; }

Property Value

TimeSpan

Stall

How long a subscriber whose buffer is full may take nothing before its call ends with RESOURCE_EXHAUSTED (configuration PubsubSubscriberStallSeconds, default DefaultStallSeconds). It only clears away clients that are gone or stuck: a subscriber that keeps taking events, however slowly, is never ended, and one that waits costs a buffer and an idle reader, nothing on the topic. Generous therefore; a consumer that stalls for longer than the stream retains (streamTTL) has a gap anyway.

public TimeSpan Stall { get; init; }

Property Value

TimeSpan

TailPoll

How long a catch-up that reached the stream's end waits before it reads again, when the subscriber could not rejoin live delivery yet: the latency it adds for a subscriber that is served from the stream.

public TimeSpan TailPoll { get; init; }

Property Value

TimeSpan

WindowEntries

Entries a catch-up remembers of what it read (stream id and identity), to tell at the handover which of them live delivery still brings. They are the ones between the sidecar's position and the stream's end, normally a few; when they are more than this, the subscriber stays on the stream for now.

public int WindowEntries { get; init; }

Property Value

int

Methods

From(string?)

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

public static PubsubDeliveryOptions From(string? stallSeconds)

Parameters

stallSeconds string

Returns

PubsubDeliveryOptions