Table of Contents

Class NatsJSPushConsumerOpts

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll

Options for creating a push consumer.

public record NatsJSPushConsumerOpts : IEquatable<NatsJSPushConsumerOpts>
Inheritance
NatsJSPushConsumerOpts
Implements
Inherited Members

Remarks

A push consumer delivers messages to a client subscription on a DeliverSubject. Unlike some NATS client libraries, this implementation requires DeliverSubject to be explicitly provided; the library does not auto-generate an inbox. Use NewBaseInbox() to generate a unique subject when needed.

Fields

Default

Default push consumer options.

Properties

AckPolicy

Acknowledgment policy for the consumer.

AckWait

How long to allow messages to remain unacknowledged before attempting a redelivery.

Backoff

An optional list of retry intervals for failed message deliveries.

DeliverGroup

The name of a deliver group (queue) for load balancing across multiple subscribers.

DeliverPolicy

Defines the start position of a consumer.

DeliverSubject

The subject the server delivers messages to. Required: consumer creation throws NatsJSException when it's not set. Callers typically pass an inbox generated with NewBaseInbox().

Description

A short description of the purpose of this consumer.

DurableName

A unique name for a durable consumer.

FilterSubject

Filter the stream by a single subject.

FilterSubjects

Filter the stream by multiple subjects.

FlowControl

Sends a control message to the consumer's deliver subject to regulate the rate of message delivery.

HeadersOnly

When true, deliver only the headers of messages, adding a Nats-Msg-Size header with the size of the removed payload.

IdleHeartbeat

Amount of idle time the server should wait before sending a heartbeat.

InactiveThreshold

A duration instructing the server to clean up the consumer once the deliver subject has no interest for that amount of time.

MaxAckPending

The maximum number of messages without acknowledgement that can be outstanding.

MaxDeliver

The number of times a message will be redelivered to consumers if not acknowledged in time.

Metadata

Optional metadata for the consumer as key-value pairs.

Name

A unique name for the consumer.

NotificationHandler

A handler function invoked for notifications related to consumption, allowing custom handling of operational updates or state changes during the consumer's lifecycle.

OptStartSeq

Start sequence for DeliverPolicy ByStartSequence.

OptStartTime

Start time for DeliverPolicy ByStartTime.

RateLimitBps

The rate limit in bits per second for message delivery.

ReplayPolicy

The replay policy for the consumer.

SubOpts

Options affecting the underlying subscription created for the delivery subject.