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
Extension Methods

Constructors

NatsJSContext(INatsConnection)

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

NatsJSContext(INatsConnection, NatsJSOpts)

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

Properties

Connection

Connection to the NATS server.

Opts

Provides configuration options for the JetStream context.

Methods

CreateConsumerAsync(string, ConsumerConfig, CancellationToken)

Creates new consumer if it doesn't exists.

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.

JSRequestResponseAsync<TRequest, TResponse>(string, TRequest?, CancellationToken)

Sends a request message to a JetStream subject and waits for a response.

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.

NewBaseInbox()

Generates a new base inbox string using the connection's inbox prefix.

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.

PublishConcurrentAsync<T>(string, T?, INatsSerialize<T>?, NatsJSPubOpts?, NatsHeaders?, CancellationToken)
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.

UpdateConsumerAsync(string, ConsumerConfig, CancellationToken)

Update consumer exists consumer

UpdateStreamAsync(StreamConfig, CancellationToken)

Update a NATS JetStream stream's properties.