Table of Contents

Class NatsBuilder

Namespace
NATS.Extensions.Microsoft.DependencyInjection
Assembly
NATS.Extensions.Microsoft.DependencyInjection.dll

Fluent builder for configuring the NATS client registered by AddNatsClient.

public class NatsBuilder
Inheritance
NatsBuilder
Inherited Members

Constructors

NatsBuilder(IServiceCollection)

Initializes a new instance of the NatsBuilder class.

Methods

AddJsonSerialization(Func<IServiceProvider, JsonSerializerContext>)
AddJsonSerialization(JsonSerializerContext)
ConfigureConnection(Action<NatsConnection>)

Registers a callback invoked on each connection after it is created.

ConfigureConnection(Action<IServiceProvider, NatsConnection>)

Registers a callback invoked on each connection after it is created, with access to the service provider.

ConfigureOptions(Action<OptionsBuilder<NatsOptsBuilder>>)

Configures the underlying NatsOptsBuilder options.

ConfigureOptions(Func<NatsOpts, NatsOpts>)
ConfigureOptions(Func<IServiceProvider, NatsOpts, NatsOpts>)
WithPoolSize(Func<IServiceProvider, int>)

Sets the connection pool size using a factory resolved from the service provider.

WithPoolSize(int)

Sets the connection pool size.

WithSerializerRegistry(INatsSerializerRegistry)

Override the default INatsSerializerRegistry for the options.

WithSubPendingChannelFullMode(BoundedChannelFullMode)

Override the default BoundedChannelFullMode for the pending messages channel.