@horizon-republic/nestjs-jetstream 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/index.cjs +2016 -441
- package/dist/index.d.cts +803 -389
- package/dist/index.d.ts +803 -389
- package/dist/index.js +1998 -426
- package/package.json +35 -11
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Events, broadcast, ordered delivery, and RPC — with two lines of config.
|
|
|
11
11
|
[](https://horizonrepublic.github.io/nestjs-jetstream/)
|
|
12
12
|
|
|
13
13
|
[](https://nodejs.org)
|
|
14
|
-
[](https://www.typescriptlang.org)
|
|
15
15
|
[](https://opensource.org/licenses/MIT)
|
|
16
16
|
|
|
17
17
|
</div>
|
|
@@ -28,7 +28,7 @@ You keep writing `@EventPattern()` and `@MessagePattern()`. The library handles
|
|
|
28
28
|
|
|
29
29
|
**Delivery modes** — workqueue (one consumer), broadcast (all consumers), ordered (sequential), and dual-mode RPC (Core or JetStream-backed).
|
|
30
30
|
|
|
31
|
-
**
|
|
31
|
+
**Operations** — dead letter queue stream, health indicator for Kubernetes probes, graceful shutdown with drain, lifecycle hooks for observability.
|
|
32
32
|
|
|
33
33
|
**Flexible** — pluggable codecs (JSON/MsgPack/Protobuf), per-stream configuration, publisher-only mode for API gateways.
|
|
34
34
|
|
|
@@ -63,6 +63,19 @@ export class OrdersController {
|
|
|
63
63
|
return this.client.emit('order.created', { orderId: 42 });
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
// main.ts — wire the JetStream microservice transport into the HTTP app
|
|
68
|
+
async function bootstrap() {
|
|
69
|
+
const app = await NestFactory.create(AppModule);
|
|
70
|
+
app.connectMicroservice(
|
|
71
|
+
{ strategy: app.get(JetstreamStrategy) },
|
|
72
|
+
{ inheritAppConfig: true },
|
|
73
|
+
);
|
|
74
|
+
app.enableShutdownHooks();
|
|
75
|
+
await app.startAllMicroservices();
|
|
76
|
+
await app.listen(3000);
|
|
77
|
+
}
|
|
78
|
+
void bootstrap();
|
|
66
79
|
```
|
|
67
80
|
|
|
68
81
|
## Documentation
|