Durable JetStream consumer, executor isolation, timestamped signatures

Featurekamo-shared-library
Shipped
May 15, 2026 at 8:48 PM UTC
Author
Kamo
Commit
e8ff33f

Three changes bundled because they all live in WebhookDeliveryWorker and make sense together: 1. Switch from core NATS dispatcher to a JetStream durable push consumer ("los-pipeline-webhook-worker", AckPolicy.Explicit). Restarts replay unacked events; attempt count comes from msg.metaData().deliveredCount() so the WebhookDelivery audit log reflects redelivery rather than an in-process loop. maxDeliver caps redelivery. 2. Dispatch each message to a small ScheduledExecutorService so a slow (10s-timeout) subscriber cannot back up the NATS dispatcher thread. 3. Sign 't.body' (Stripe/GitHub style) and emit headers X-Kamo-Timestamp + X-Kamo-Signature: t=<ts>,v1=<hex> so an eavesdropped request cannot be replayed indefinitely. deliverForOrg is no longer @Transactional: a failed HTTP attempt re-throws so JetStream redelivers, and we want the audit row to persist in its own short transaction rather than rolling back with the outer scope.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing