FetchMessagesAsync Method
Definition
- Namespace
- Savvyio.Extensions.NATS.Commands
- Assemblies
- Savvyio.Extensions.NATS.dll
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
consumerINatsJSConsumerThe consumer to fetch messages from.
optionsNatsJSFetchOptsThe fetch options.
cancellationTokenCancellationTokenThe cancellation token of the asynchronous operation.
Returns
- IAsyncEnumerable<NatsCommandQueue.ReceivedNatsMessage>
An asynchronous sequence of received NATS messages.