Table of Contents

Method CreateOrUpdateStreamAsync

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

CreateOrUpdateStreamAsync(StreamConfig, CancellationToken)

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

public ValueTask<INatsJSStream> CreateOrUpdateStreamAsync(StreamConfig config, CancellationToken cancellationToken = default)

Parameters

config StreamConfig

Stream configuration request to be sent to NATS JetStream server.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<INatsJSStream>

The NATS JetStream stream object which can be used to manage the stream.

Exceptions

NatsJSException

There was an issue retrieving the response.

NatsJSApiException

Server responded with an error.

ArgumentException

The stream name in config is invalid.

ArgumentNullException

The name in config is null.