@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.
- package/README.md +12 -6
- 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
|
|
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
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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>
|