Table of Contents

FetchMessagesAsync Method

Definition

Namespace
Savvyio.Extensions.NATS.Commands
Assemblies
Savvyio.Extensions.NATS.dll
Source
src/Savvyio.Extensions.NATS/Commands/NatsCommandQueue.cs

FetchMessagesAsync(INatsJSConsumer, NatsJSFetchOpts, CancellationToken)

Fetches messages from the specified NATS JetStream consumer.

protected virtual IAsyncEnumerable<NatsCommandQueue.ReceivedNatsMessage> FetchMessagesAsync(INatsJSConsumer consumer, NatsJSFetchOpts options, CancellationToken cancellationToken)

Parameters

consumer INatsJSConsumer

The consumer to fetch messages from.

options NatsJSFetchOpts

The fetch options.

cancellationToken CancellationToken

The cancellation token of the asynchronous operation.

Returns

IAsyncEnumerable<NatsCommandQueue.ReceivedNatsMessage>

An asynchronous sequence of received NATS messages.