NatsCommandQueueOptions Class
Definition
- Namespace
- Savvyio.Extensions.NATS.Commands
- Assemblies
- Savvyio.Extensions.NATS.dll
Configuration options for NatsCommandQueue.
public class NatsCommandQueueOptions : NatsMessageOptions, IValidatableParameterObject, IParameterObject
- Inheritance
-
objectNatsCommandQueueOptions
- Implements
- Derived
- Inherited Members
Examples
Configure a NatsCommandQueueOptions with the NATS JetStream stream, consumer, and subject settings required for command queue delivery.
using System;
using Savvyio.Extensions.NATS.Commands;
namespace ExampleApp;
public class NatsCommandSetup
{
public static NatsCommandQueueOptions CreateOptions()
{
var options = new NatsCommandQueueOptions
{
NatsUrl = new Uri("nats://localhost:4222"),
Subject = "commands",
StreamName = "savvyio-commands",
ConsumerName = "account-command-consumer",
AutoAcknowledge = true
};
return options;
}
}
Constructors
| Name | Description |
|---|---|
| NatsCommandQueueOptions() | Initializes a new instance of the NatsCommandQueueOptions class. |
Properties
| Name | Description |
|---|---|
| AutoAcknowledge | Gets or sets a value indicating whether messages should be automatically acknowledged. |
| ConsumerName | Gets or sets the name of the NATS consumer. |
| Expires | Gets or sets the expiration time for messages in the queue. |
| Heartbeat | Gets or sets the interval for the heartbeat signal sent from the NATS server. |
| MaxMessages | Gets or sets the maximum number of messages to process. |
| StreamName | Gets or sets the name of the NATS stream. |
Methods
| Name | Description |
|---|---|
| ValidateOptions() | Validates the options for the NATS command queue. |