Table of Contents

Method GetConsumerAsync

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

GetConsumerAsync(string, string, CancellationToken)

Gets consumer information from the server and creates a NATS JetStream consumer NatsJSConsumer.

public ValueTask<INatsJSConsumer> GetConsumerAsync(string stream, string consumer, CancellationToken cancellationToken = default)

Parameters

stream string

Stream name where consumer is associated to.

consumer string

Consumer name.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<INatsJSConsumer>

The NATS JetStream consumer object which can be used retrieving data from 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 is null.