Skip to content

Add additive MQTT 5 protocol support - #232

Draft
Namoshek with Copilot wants to merge 4 commits into
masterfrom
copilot/plan-mqtt5-support
Draft

Add additive MQTT 5 protocol support#232
Namoshek with Copilot wants to merge 4 commits into
masterfrom
copilot/plan-mqtt5-support

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown

The client only supported MQTT 3.x, while its generic message processor and persistence contracts could not model MQTT 5 properties, acknowledgements, authentication, negotiation, or session flows. This change adds MQTT 5 without changing the default protocol or legacy basic APIs.

  • Protocol architecture

    • Add strict binary primitives, incremental framing, typed packets, ordered properties, and MQTT 5 codecs for CONNECT through AUTH.
    • Validate flags, reason codes, property placement, UTF-8, topics, filters, packet identifiers, and negotiated packet limits.
  • Public API

    • Add MQTT_5_0, immutable MQTT 5 options/results, typed callbacks, and a separate advanced capability interface.
    • Preserve existing constructors, callbacks, MQTT 3.x behavior, and simple operations.
$client = new MqttClient(
    'localhost',
    1883,
    'client-id',
    MqttClient::MQTT_5_0,
);

$client->connect();
$client->publish('events/example', 'payload');
  • Runtime behavior

    • Support negotiated capabilities, topic aliases, enhanced authentication, session expiry, reconnect/resume behavior, and server DISCONNECT events.
    • Add explicit QoS stages, receive-maximum flow control, queued publications, and message expiry.
    • Extend repository persistence with a compatibility adapter for legacy implementations.
  • Safety and conformance

    • Distinguish malformed packets from protocol errors and redact sensitive wire data from logs.
    • Add packet vectors, malformed-input and state-machine coverage, MQTT 3.x regressions, broker interoperability tests, compliance traceability, migration guidance, and security documentation.
  • CI

    • Replace privileged pull-request execution with least-privilege jobs.
    • Split quality, unit, integration, coverage, cross-broker, and pinned Paho conformance workflows.

Copilot AI and others added 4 commits August 5, 2026 16:12
Co-authored-by: Namoshek <8877609+Namoshek@users.noreply.github.com>
Co-authored-by: Namoshek <8877609+Namoshek@users.noreply.github.com>
Co-authored-by: Namoshek <8877609+Namoshek@users.noreply.github.com>
Co-authored-by: Namoshek <8877609+Namoshek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants