JetstreamModule
@horizon-republic/nestjs-jetstream
@horizon-republic/nestjs-jetstream / JetstreamModule
JetstreamModule
Defined in: src/jetstream.module.ts:158
Implements
OnApplicationBootstrapOnApplicationShutdown
Constructors
Constructor
new JetstreamModule(
shutdownManager?,registry?):JetstreamModule
Defined in: src/jetstream.module.ts:159
Parameters
shutdownManager?
ShutdownManager
registry?
ConnectionRegistry
Returns
JetstreamModule
Methods
onApplicationBootstrap()
onApplicationBootstrap():
Promise<void>
Defined in: src/jetstream.module.ts:441
Verify every configured connection actually started.
Runs after startAllMicroservices() in a hybrid application.
Returns
Promise<void>
Implementation of
OnApplicationBootstrap.onApplicationBootstrap
onApplicationShutdown()
onApplicationShutdown():
Promise<void>
Defined in: src/jetstream.module.ts:451
Gracefully shut down the transport on application termination.
Returns
Promise<void>
Implementation of
OnApplicationShutdown.onApplicationShutdown
forFeature()
staticforFeature(options):DynamicModule
Defined in: src/jetstream.module.ts:243
Register a lightweight client proxy for a target service.
Reuses the NATS connection from forRoot(). Import in each feature module
that needs to communicate with a specific service. Pass connection to
publish on a named connection instead of the default one.
Parameters
options
Feature options with target service name.
Returns
DynamicModule
Dynamic module with the client provider.
forRoot()
staticforRoot(options):DynamicModule
Defined in: src/jetstream.module.ts:177
Register the JetStream transport globally.
Creates a shared NATS connection, codec, event bus, and optionally the full consumer infrastructure (streams, consumers, routers).
Parameters
options
Module configuration.
Returns
DynamicModule
Dynamic module ready to be imported.
forRootAsync()
staticforRootAsync(asyncOptions):DynamicModule
Defined in: src/jetstream.module.ts:209
Register the JetStream transport globally with async configuration.
Supports useFactory, useExisting, and useClass patterns
for loading configuration from ConfigService, environment, etc.
Parameters
asyncOptions
Async configuration.
Returns
DynamicModule
Dynamic module ready to be imported.