Table of Contents

Method CreateOrUpdateConsumerAsync

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

CreateOrUpdateConsumerAsync(ConsumerConfig, CancellationToken)

Creates new consumer if it doesn't exists or updates an existing one with the same name.

public ValueTask<INatsJSConsumer> CreateOrUpdateConsumerAsync(ConsumerConfig config, CancellationToken cancellationToken = default)

Parameters

config ConsumerConfig

Consumer configuration.

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

Ack policy is set to none or 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.