Table of Contents

Method CreateStreamAsync

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

CreateStreamAsync(StreamConfig, CancellationToken)

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

ValueTask<INatsJSStream> CreateStreamAsync(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.