Commit Graph

1 Commits

Author SHA1 Message Date
Joseph Doherty
6a030151fc feat(batch47): implement MQTT full runtime — JSA bridge, sessions, account manager, protocol handlers
- MqttJsa.cs: full JetStream API bridge (22 features, Sub-batch A 2269-2290)
  - Async request/response helpers, consumer/stream CRUD, msg store/load/delete
  - Send queue via Channel<MqttJsPubMsg>, ConcurrentDictionary reply tracking

- MqttAccountSessionManager.cs: per-account MQTT session manager (26 features, Sub-batch C 2292-2322)
  - Session add/remove/lock/unlock, flapper tracking with cleanup timer
  - Retained message in-memory cache with TTL eviction (ConcurrentDictionary)
  - JSA reply dispatch, retained msg processing, session persist detection
  - Subscription creation, retained message subject matching (SubscriptionIndex)
  - createOrRestoreSession async (JetStream load + fallback to new session)
  - processSubs builds NATS subscriptions with retained message delivery
  - Stream migration stubs (transferUniqueSessStreamsToMuxed, transferRetained...)

- MqttTypes.cs: add Client and Seq to MqttSession; ExpiresFromCache to MqttRetainedMsg
  - Remove stubs for MqttJsa and MqttAccountSessionManager

- MqttHelpers.cs: standalone helpers (Sub-batch F 2264-2268)
  - IsMqttReservedSubscription, DecodeRetainedMessage, GeneratePubPerms,
    CheckPubRetainedPerms, TopicFilterContainsWildcard, TopicToNatsSubject

- ClientConnection.Mqtt.cs: Mqtt property stub on ClientConnection (Sub-batch E entry)

- Subscription.cs: add internal Mqtt (MqttSub?) and InternalCallback fields

All 2660 unit tests pass, 0 failures.
2026-03-01 10:14:47 -05:00