Skip to main content

connectJetstreamMicroservices()

@horizon-republic/nestjs-jetstream


@horizon-republic/nestjs-jetstream / connectJetstreamMicroservices

connectJetstreamMicroservices()

connectJetstreamMicroservices(app, options?): void

Defined in: src/bootstrap/connect-microservices.ts:26

Attach one NestJS microservice per configured connection.

Publisher-only connections have no strategy and are skipped. Call await app.startAllMicroservices() afterwards, as with any hybrid app.

Parameters​

app​

INestApplication

The hybrid Nest application.

options?​

JetstreamBootstrapOptions

Hybrid options forwarded to every microservice.

Returns​

void

Example​

const app = await NestFactory.create(AppModule);

connectJetstreamMicroservices(app);
await app.startAllMicroservices();
await app.listen(3000);