@crossdelta/cloudevents 0.5.1 → 0.5.2

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.
Files changed (2) hide show
  1. package/README.md +12 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -340,8 +340,10 @@ const redisStore = {
340
340
  add: (id, ttl) => redis.set(`idem:${id}`, '1', 'PX', ttl),
341
341
  }
342
342
 
343
- await consumeJetStreamEvents({
344
- // ...
343
+ await consumeJetStreams({
344
+ streams: ['ORDERS'],
345
+ consumer: 'my-service',
346
+ discover: './src/events/**/*.event.ts',
345
347
  idempotencyStore: redisStore,
346
348
  })
347
349
  ```
@@ -354,13 +356,17 @@ await consumeJetStreamEvents({
354
356
  Invalid messages are quarantined, not lost:
355
357
 
356
358
  ```typescript
357
- await consumeJetStreamEvents({
358
- // ...
359
- quarantineTopic: 'events.quarantine',
360
- errorTopic: 'events.errors',
359
+ await consumeJetStreams({
360
+ streams: ['ORDERS'],
361
+ consumer: 'my-service',
362
+ discover: './src/events/**/*.event.ts',
363
+ quarantineTopic: 'events.quarantine', // For malformed messages
364
+ errorTopic: 'events.errors', // For handler errors
361
365
  })
362
366
  ```
363
367
 
368
+ Messages that fail validation go to `quarantineTopic`, messages that crash handlers go to `errorTopic`.
369
+
364
370
  </details>
365
371
 
366
372
  <details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossdelta/cloudevents",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "CloudEvents toolkit for TypeScript - Zod validation, handler discovery, NATS JetStream",
5
5
  "author": "crossdelta",
6
6
  "license": "MIT",