Table of Contents

Method GetConsumerAsync

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

GetConsumerAsync(string, CancellationToken)

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

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

Parameters

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 is an error retrieving the response or this consumer object isn't valid anymore because it was deleted earlier.

NatsJSApiException

Server responded with an error.