NatsMessageOptions Class
Definition
- Namespace
- Savvyio.Extensions.NATS
- Assemblies
- Savvyio.Extensions.NATS.dll
Configuration options that is related to NATS.
public class NatsMessageOptions : IValidatableParameterObject, IParameterObject
- Inheritance
-
objectNatsMessageOptions
- Implements
- Derived
Examples
Configure a NatsMessageOptions to point at a NATS server and specify the subject for message delivery.
using System;
using Savvyio.Extensions.NATS;
namespace ExampleApp;
public class NatsSetup
{
public static NatsMessageOptions CreateOptions()
{
var options = new NatsMessageOptions
{
NatsUrl = new Uri("nats://localhost:4222"),
Subject = "account-commands"
};
return options;
}
}
Constructors
| Name | Description |
|---|---|
| NatsMessageOptions() | Initializes a new instance of the NatsMessageOptions class with default values. |
Properties
| Name | Description |
|---|---|
| NatsUrl | Gets or sets the URI of the NATS server. |
| Subject | Gets or sets the subject to publish or subscribe to in NATS. |
Methods
| Name | Description |
|---|---|
| ValidateOptions() | Validates the current options and throws an exception if the state is invalid. |