Table of Contents

Interface INatsJSContext

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll
public interface INatsJSContext
Extension Methods

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.

CreateOrUpdatePushConsumerAsync(string, NatsJSPushConsumerOpts?, CancellationToken)

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

CreateOrUpdateStreamAsync(StreamConfig, CancellationToken)

Creates a new stream if it doesn't exist or update if the stream already exists.

CreateOrderedConsumerAsync(string, NatsJSOrderedConsumerOpts?, CancellationToken)

Creates new ordered consumer.

CreateOrderedPushConsumerAsync(string, NatsJSOrderedConsumerOpts?, CancellationToken)

Creates a new ordered push consumer that ensures messages are delivered in the exact order they were published to the stream, recreating the underlying ephemeral consumer if it skips or mismatches sequences.

CreatePushConsumerAsync(string, NatsJSPushConsumerOpts?, CancellationToken)

Creates a new push consumer that delivers messages to the subject given in DeliverSubject.

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.

GetPushConsumerAsync(string, string, CancellationToken)

Gets an existing push consumer from the server and creates a INatsJSPushConsumer handle for it.

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.

ResetConsumerAsync(string, string, ulong, CancellationToken)

Reset a consumer's delivery state.

ResumeConsumerAsync(string, string, CancellationToken)

Resume a (paused) consumer.

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

Tries to send data to a stream associated with the subject.

UnpinConsumerAsync(string, string, string, CancellationToken)

Unpin a consumer from the currently pinned client.

UpdateConsumerAsync(string, ConsumerConfig, CancellationToken)

Update consumer exists consumer

UpdateStreamAsync(StreamConfig, CancellationToken)

Update a NATS JetStream stream's properties.