Table of Contents

Method ListConsumersAsync

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

ListConsumersAsync(string, CancellationToken)

Enumerates through consumers belonging to a stream.

public IAsyncEnumerable<INatsJSConsumer> ListConsumersAsync(string stream, CancellationToken cancellationToken = default)

Parameters

stream string

Stream name the consumers belong to.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

IAsyncEnumerable<INatsJSConsumer>

Async enumerable of consumer info objects. Can be used in a await foreach loop.

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.