Table of Contents

Class NatsJSContext

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

Provides management and access to NATS JetStream streams and consumers.

public class NatsJSContext : INatsJSContext
Inheritance
NatsJSContext
Implements
Inherited Members

Constructors

NatsJSContext(NatsConnection)

Creates a NATS JetStream context used to manage and access streams and consumers.

NatsJSContext(NatsConnection, NatsJSOpts)

Creates a NATS JetStream context used to manage and access streams and consumers.

Methods

CreateOrUpdateConsumerAsync(string, ConsumerConfig, CancellationToken)

Creates new consumer if it doesn't exists or updates an existing one with the same name.

CreateOrderedConsumerAsync(string, NatsJSOrderedConsumerOpts?, CancellationToken)

Creates new ordered consumer.

CreateStreamAsync(StreamConfig, CancellationToken)

Creates a new stream if it doesn't exist or returns an existing stream with the same name.

DeleteConsumerAsync(string, string, CancellationToken)

Delete a consumer from a stream.

DeleteMessageAsync(string, StreamMsgDeleteRequest, CancellationToken)

Deletes a message from a stream.

DeleteStreamAsync(string, CancellationToken)

Deletes a stream.

GetAccountInfoAsync(CancellationToken)

Calls JetStream Account Info API.

GetConsumerAsync(string, string, CancellationToken)

Gets consumer information from the server and creates a NATS JetStream consumer NatsJSConsumer.

GetStreamAsync(string, StreamInfoRequest?, CancellationToken)

Get stream information from the server and creates a NATS JetStream stream object NatsJSStream.

ListConsumerNamesAsync(string, CancellationToken)

Enumerates through consumer names belonging to a stream.

ListConsumersAsync(string, CancellationToken)

Enumerates through consumers belonging to a stream.

ListStreamNamesAsync(string?, CancellationToken)

List stream names.

ListStreamsAsync(string?, CancellationToken)

Enumerates through the streams exists on the NATS JetStream server.

PauseConsumerAsync(string, string, DateTimeOffset, CancellationToken)

Pause a consumer.

PublishAsync<T>(string, T?, INatsSerialize<T>?, NatsJSPubOpts?, NatsHeaders?, CancellationToken)

Sends data to a stream associated with the subject.

PurgeStreamAsync(string, StreamPurgeRequest, CancellationToken)

Purges all of the (or filtered) data in a stream, leaves the stream.

ResumeConsumerAsync(string, string, CancellationToken)

Resume a (paused) consumer.

UpdateStreamAsync(StreamConfig, CancellationToken)

Update a NATS JetStream stream's properties.