dotnet-cqrs/Svrnty.CQRS.Events.ConsumerGroups.Abstractions/ConsumerInfo.cs

36 lines
946 B
C#

using System;
using System.Collections.Generic;
namespace Svrnty.CQRS.Events.ConsumerGroups.Abstractions;
/// <summary>
/// Information about a consumer in a consumer group.
/// </summary>
public record ConsumerInfo
{
/// <summary>
/// The consumer ID.
/// </summary>
public required string ConsumerId { get; init; }
/// <summary>
/// The consumer group ID.
/// </summary>
public required string GroupId { get; init; }
/// <summary>
/// The last heartbeat timestamp from this consumer.
/// </summary>
public required DateTimeOffset LastHeartbeat { get; init; }
/// <summary>
/// When the consumer was first registered.
/// </summary>
public required DateTimeOffset RegisteredAt { get; init; }
/// <summary>
/// Optional metadata about the consumer (e.g., hostname, version).
/// </summary>
public IReadOnlyDictionary<string, string>? Metadata { get; init; }
}