Table of Contents

Method FetchAsync

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

FetchAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)

Consume messages using a pull subscription on this consumer.

public IAsyncEnumerable<INatsJSMsg<T>> FetchAsync<T>(NatsJSFetchOpts opts, INatsDeserialize<T>? serializer = null, CancellationToken cancellationToken = default)

Parameters

opts NatsJSFetchOpts
serializer INatsDeserialize<T>
cancellationToken CancellationToken

Returns

IAsyncEnumerable<INatsJSMsg<T>>

Type Parameters

T

Message type to deserialize.

Remarks

Push consumers don't support this operation.

Exceptions

NatsJSProtocolException

Consumer is push based.