Joseph Doherty
612b15c781
feat: add PushConsumer delivery loop and RedeliveryTracker (C3+C4)
C3 – PushConsumerEngine delivery dispatch:
- Add DeliverSubject property (mirrors consumer.go:1131 dsubj field)
- Add StartDeliveryLoop / StopDeliveryLoop: background Task that drains
ConsumerHandle.PushFrames and calls a sendMessage delegate per frame
- Delivery loop honours AvailableAtUtc for rate-limiting (consumer.go:5120)
- Data frames: HMSG headers Nats-Sequence, Nats-Time-Stamp, Nats-Subject
(stream.go:586 JSSequence / JSTimeStamp / JSSubject constants)
- Flow-control frames: "NATS/1.0 100 FlowControl Request" (consumer.go:5501)
- Heartbeat frames: "NATS/1.0 100 Idle Heartbeat" (consumer.go:5222)
- Add DeliverSubject field to ConsumerConfig (consumer.go:115)
C4 – RedeliveryTracker with backoff schedules:
- Schedule(seq, deliveryCount, ackWaitMs): computes deadline using backoff
array indexed by (deliveryCount-1), clamped at last entry (consumer.go:5540)
- GetDue(): returns sequences whose deadline has passed
- Acknowledge(seq): removes sequence from tracking
- IsMaxDeliveries(seq, maxDeliver): checks threshold for drop decision
- Empty backoff array falls back to ackWaitMs
Tests: 7 PushConsumerDelivery tests + 10 RedeliveryTracker tests (17 total)
2026-02-24 15:01:15 -05:00
..
2026-02-23 19:55:31 -05:00
2026-02-24 08:39:32 -05:00
2026-02-24 15:01:15 -05:00
2026-02-24 14:43:06 -05:00
2026-02-23 19:55:31 -05:00
2026-02-24 06:47:17 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 22:35:06 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 22:35:06 -05:00
2026-02-23 13:43:14 -05:00
2026-02-24 06:47:17 -05:00
2026-02-23 22:35:06 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 15:03:35 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 13:43:14 -05:00
2026-02-24 06:47:17 -05:00
2026-02-24 12:39:32 -05:00
2026-02-23 13:08:52 -05:00
2026-02-24 12:39:32 -05:00
2026-02-23 14:51:30 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 14:51:30 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 14:54:30 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 14:50:18 -05:00
2026-02-24 06:47:17 -05:00
2026-02-23 22:35:06 -05:00
2026-02-23 14:54:30 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 14:47:24 -05:00
2026-02-24 06:03:46 -05:00
2026-02-23 22:35:06 -05:00
2026-02-24 06:47:17 -05:00
2026-02-23 22:35:06 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 13:08:52 -05:00
2026-02-23 13:43:14 -05:00
2026-02-23 19:55:31 -05:00
2026-02-23 19:55:31 -05:00
2026-02-23 19:55:31 -05:00