Table of Contents

Method GetStreamAsync

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

GetStreamAsync(string, StreamInfoRequest?, CancellationToken)

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

ValueTask<INatsJSStream> GetStreamAsync(string stream, StreamInfoRequest? request = null, CancellationToken cancellationToken = default)

Parameters

stream string

Name of the stream to retrieve.

request StreamInfoRequest

Stream info request options

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.