Class ConnectionEvent

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

One change of a supervised connection: lost, a reconnect attempt failed, restored. A
reports it; the route context hands it to every
and, as the events ConnectionLost,
ReconnectFailed and ConnectionRestored, to the routes that read controlbus:notify. Listeners get
it from a queue, after the change: what they do cannot hold up or break the reconnect.

public sealed record ConnectionEvent : IEquatable<ConnectionEvent>

Inheritance

Object→ConnectionEvent

Implements

Properties

Attempt

Failed attempts since the loss; 0 on .

public int Attempt { get; init; }

Connection

The supervisor's name: which connection or link.

public string Connection { get; init; }

Endpoint

The endpoint the connection belongs to, in its short form with secrets masked.

public string Endpoint { get; init; }

Error

The exception of the loss or of the failed attempt; null on .

public Exception? Error { get; init; }

ErrorMessage

The message of with secrets masked, as the log and the health reason show it.

public string? ErrorMessage { get; init; }

Kind

What changed.

public ConnectionEventKind Kind { get; init; }

NextDelay

Time until the next attempt; null on .

public TimeSpan? NextDelay { get; init; }

Outage

How long the connection has been lost; on , how long it was.

public TimeSpan Outage { get; init; }

Reconnects

Losses this supervisor recovered from, this one included when restored.

public long Reconnects { get; init; }

RouteId

The route that reads from the endpoint; null for a producer, or when several routes share it.

public string? RouteId { get; init; }

State

The state after the change.

public ConnectionState State { get; init; }

Time

When the change happened.

public DateTimeOffset Time { get; init; }

Constructors

ConnectionEvent(ConnectionEventKind, string, ConnectionState, Exception?, int, TimeSpan?, TimeSpan, long, DateTimeOffset)

One change of a supervised connection: lost, a reconnect attempt failed, restored. A