Commit Graph

12 Commits

Author SHA1 Message Date
Joseph Doherty
96db73d1c6 feat: deliver retained messages on MQTT SUBSCRIBE (Gap 6.5)
Add DeliverRetainedOnSubscribe to MqttRetainedStore, which iterates
GetMatchingRetained and fires a callback with (topic, payload, qos,
retain=true) for each match. Add 11 unit tests covering exact-match,
'+' single-level, '#' multi-level, no-match, cross-level rejection,
callback arguments, return count, and empty-store behaviour.
2026-02-25 11:40:50 -05:00
Joseph Doherty
f069fdc76a feat: add MQTT MaxAckPending flow control (Gap 6.4)
Implements MqttFlowController with per-subscription SemaphoreSlim-based
slot tracking for QoS 1/2 messages. Replaces the previous catch-and-swallow
pattern with an explicit CurrentCount guard on Release. 10 unit tests added.
2026-02-25 11:38:47 -05:00
Joseph Doherty
a44ad4b7fc feat: add MQTT will message delivery on abnormal disconnect (Gap 6.2)
Adds WillMessage class, SetWill/ClearWill/GetWill methods to MqttSessionStore,
PublishWillMessage that dispatches via OnPublish delegate (or tracks as delayed
when DelayIntervalSeconds > 0), and 10 unit tests covering all will message behaviors.
2026-02-25 11:38:43 -05:00
Joseph Doherty
579063dabd test(parity): port 373 Go tests across protocol and services subsystems (C11+E15)
Protocol (C11):
- ClientProtocolGoParityTests: 45 tests (header stripping, tracing, limits, NRG)
- ConsumerGoParityTests: 60 tests (filters, actions, pinned, priority groups)
- JetStreamGoParityTests: 38 tests (stream CRUD, purge, mirror, retention)

Services (E15):
- MqttGoParityTests: 65 tests (packet parsing, QoS, retained, sessions)
- WsGoParityTests: 58 tests (compression, JWT auth, frame encoding)
- EventGoParityTests: 56 tests (event DTOs, serialization, health checks)
- AccountGoParityTests: 28 tests (route mapping, system account, limits)
- MonitorGoParityTests: 23 tests (connz filtering, pagination, sort)

DB: 1,148/2,937 mapped (39.1%), up from 1,012 (34.5%)
2026-02-24 16:52:15 -05:00
Joseph Doherty
e49e5895c1 feat(mqtt): add session persistence, QoS 2 state machine, and retained store (E2+E3)
Add MqttSessionStore with save/load/delete/list operations, flapper
detection (backoff on rapid reconnects), and TimeProvider-based testing.
Add MqttRetainedStore for per-topic retained messages with MQTT wildcard
matching (+/# filters). Add MqttQos2StateMachine tracking the full
PUBREC/PUBREL/PUBCOMP flow with duplicate rejection and timeout detection.

19 new tests: 9 session persistence, 10 QoS/retained message tests.
2026-02-24 15:13:34 -05:00
Joseph Doherty
b6c373c5e4 feat(mqtt): add MqttBinaryDecoder with CONNECT/PUBLISH/SUBSCRIBE parsing and 27 tests
Port binary MQTT 3.1.1 packet body decoding from Go mqtt.go (~lines 700–1500, 2200).
MqttBinaryDecoder parses CONNECT (protocol name, connect flags, keepalive, client ID,
will topic/message, username, password), PUBLISH (topic, packet ID for QoS>0, DUP/
RETAIN flags, application payload), and SUBSCRIBE (packet ID, topic-filter + QoS list).
Adds TranslateFilterToNatsSubject for simple MQTT wildcard conversion (+ → *, # → >,
/ → .). All 27 tests in MqttBinaryParserTests pass.
2026-02-24 14:58:48 -05:00
Joseph Doherty
9554d53bf5 feat: Wave 6 batch 1 — monitoring, config reload, client protocol, MQTT, leaf node tests
Port 405 new test methods across 5 subsystems for Go parity:
- Monitoring: 102 tests (varz, connz, routez, subsz, stacksz)
- Leaf Nodes: 85 tests (connection, forwarding, loop detection, subject filter, JetStream)
- MQTT Bridge: 86 tests (advanced, auth, retained messages, topic mapping, will messages)
- Client Protocol: 73 tests (connection handling, protocol violations, limits)
- Config Reload: 59 tests (hot reload, option changes, permission updates)

Total: 1,678 tests passing, 0 failures, 3 skipped
2026-02-23 21:40:29 -05:00
Joseph Doherty
553483b6ba feat: phase D protocol surfaces test parity — 75 new tests across MQTT and JWT
MQTT packet parsing (41 tests), QoS/session delivery (8 tests),
and JWT claim edge cases (43 new tests). All 4 phases complete.
1081 total tests passing, 0 failures.
2026-02-23 20:06:54 -05:00
Joseph Doherty
b2312c0dac feat: enforce mqtt auth tls and keepalive semantics 2026-02-23 14:45:37 -05:00
Joseph Doherty
7dcf5776b3 feat: implement mqtt session and qos ack runtime semantics 2026-02-23 14:43:08 -05:00
Joseph Doherty
7faf42c588 feat: implement mqtt packet-level parser and writer 2026-02-23 14:41:23 -05:00
Joseph Doherty
2b64d762f6 feat: execute full-repo remaining parity closure plan 2026-02-23 13:08:52 -05:00