Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add priority group options #743

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/NATS.Client.JetStream/Models/ConsumerGetnextRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,40 @@ public record ConsumerGetnextRequest
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
[System.Text.Json.Serialization.JsonConverter(typeof(NatsJSJsonNanosecondsConverter))]
public TimeSpan IdleHeartbeat { get; set; }

/// <summary>
/// Priority group.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyName("group")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public string? Group { get; set; }

/// <summary>
/// Priority group minimum pending messages.
/// </summary>
/// <remarks>
/// When specified, this Pull request will only receive messages when the consumer has at least this many pending messages.
/// </remarks>
[System.Text.Json.Serialization.JsonPropertyName("min_pending")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
[System.ComponentModel.DataAnnotations.Range(long.MinValue, long.MaxValue)]
public long MinPending { get; set; }

/// <summary>
/// Priority group minimum ACK pending messages.
/// </summary>
/// <remarks>
/// When specified, this Pull request will only receive messages when the consumer has at least this many ack pending messages.
/// </remarks>
[System.Text.Json.Serialization.JsonPropertyName("min_ack_pending")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
[System.ComponentModel.DataAnnotations.Range(long.MinValue, long.MaxValue)]
public long MinAckPending { get; set; }

/// <summary>
/// Priority group ID.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyName("id")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public string? Id { get; set; }
}
Loading