Skip to content
Docs Try Aspire

AspireNatsClientExtensions

Class static net10.0
📦 Aspire.NATS.Net v13.1.2
Extension methods for connecting NATS server with NATS client
namespace Microsoft.Extensions.Hosting;
public static class AspireNatsClientExtensions
{
// ...
}
AddKeyedNatsClient(IHostApplicationBuilder, string)extension
AddKeyedNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>)extension
AddKeyedNatsClient(IHostApplicationBuilder, string, Func<NatsOpts, NatsOpts>)extension
AddKeyedNatsClient(IHostApplicationBuilder, string, Func<IServiceProvider, NatsOpts, NatsOpts>)extension
AddKeyedNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>, Func<NatsOpts, NatsOpts>)extension
AddKeyedNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>, Func<IServiceProvider, NatsOpts, NatsOpts>)extension
Registers Core.INatsConnection as a keyed service for given name for connecting NATS server with NATS client. Configures health check and logging for the NATS client.
AddNatsClient(IHostApplicationBuilder, string)extension
AddNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>)extension
AddNatsClient(IHostApplicationBuilder, string, Func<NatsOpts, NatsOpts>)extension
AddNatsClient(IHostApplicationBuilder, string, Func<IServiceProvider, NatsOpts, NatsOpts>)extension
AddNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>, Func<NatsOpts, NatsOpts>)extension
AddNatsClient(IHostApplicationBuilder, string, Action<NatsClientSettings>, Func<IServiceProvider, NatsOpts, NatsOpts>)extension
Registers Core.INatsConnection service for connecting NATS server with NATS client. Configures health check and logging for the NATS client.
AddNatsJetStream(IHostApplicationBuilder)extension
Registers JetStream.INatsJSContext service for NATS JetStream operations.
View all methods