Method GetStreamAsync
GetStreamAsync(string, StreamInfoRequest?, CancellationToken)
Get stream information from the server and creates a NATS JetStream stream object NatsJSStream.
public ValueTask<INatsJSStream> GetStreamAsync(string stream, StreamInfoRequest? request = null, CancellationToken cancellationToken = default)
Parameters
stream
stringName of the stream to retrieve.
request
StreamInfoRequestStream info request options
cancellationToken
CancellationTokenA 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 is invalid.- ArgumentNullException
The
stream
name isnull
.