Method CreateStreamAsync
CreateStreamAsync(StreamConfig, CancellationToken)
Creates a new stream if it doesn't exist or returns an existing stream with the same name.
public ValueTask<INatsJSStream> CreateStreamAsync(StreamConfig config, CancellationToken cancellationToken = default)
Parameters
config
StreamConfigStream configuration request to be sent to NATS JetStream server.
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 in
config
is invalid.- ArgumentNullException
The name in
config
isnull
.