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)
7.5 KiB
7.5 KiB