Class NatsJSPushConsumer
Represents a NATS JetStream push consumer.
public class NatsJSPushConsumer : INatsJSPushConsumer, INatsJSConsumer
- Inheritance
-
NatsJSPushConsumer
- Implements
- Inherited Members
Remarks
A push consumer subscribes to the consumer's deliver subject and receives the messages as they are pushed by the JetStream server. Whether a message requires an acknowledgment depends on the consumer's ConsumerConfigAckPolicy, see AckPolicy for details.
The server manages the message delivery for the consumer, so pull based operations (NextAsync<T>(INatsDeserialize<T>?, NatsJSNextOpts?, CancellationToken), FetchAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken) and FetchNoWaitAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)) are not supported and throw a NatsJSProtocolException.
Properties
- Info
Consumer info object as retrieved from NATS JetStream server at the time this object was created, updated or refreshed.
Methods
- ConsumeAsync<T>(INatsDeserialize<T>?, NatsJSConsumeOpts?, CancellationToken)
Starts an enumerator consuming messages from this push consumer.
- DeleteAsync(CancellationToken)
Delete this consumer.
- FetchAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)
Consume messages using a pull subscription on this consumer.
- FetchNoWaitAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)
Consume a set number of messages using a pull subscription on this consumer without waiting.
- NextAsync<T>(INatsDeserialize<T>?, NatsJSNextOpts?, CancellationToken)
Consume a single message using a pull subscription on this consumer.
- RefreshAsync(CancellationToken)
Retrieve the consumer info from the server and update this consumer.
- ResetAsync(ulong, CancellationToken)
Reset this consumer's delivery state and update this consumer.
- UnpinAsync(string, CancellationToken)
Unpins this consumer from the current pinned client.