Skip to content

MQTT v5: honor client-advertised maximum payload size #834

Open

Description

@kriszyp

Request

MQTT v5 allows clients to advertise their maximum packet size in the CONNECT packet. Harper should honor this limit and reject PUBLISH packets exceeding the client's declared maximum.

🤖 Filed by Claude on behalf of Kris.

Activity

  1. added
    enhancementNew feature or request
    from-jiraMigrated or originated from a Jira ticket
    area:MQTTMQTT protocol support
    on May 27, 2026
  2. maurice-harper commented on Nov 10, 2026

    @maurice-harper
    Contributor

    Reproduced on harper-pro 5.4.0-beta.2, on a single node and on a 2-region cluster. This is the outbound direction: the server sending more than the client advertised.

    A packet-level MQTT v5 client connects with maximumPacketSize: 120 and subscribes at QoS 0. A small message is published, then one with a ~500-byte value. The client receives both, and the second PUBLISH is 531 bytes. [MQTT-3.1.2-24] says the server must not send a packet over the client's maximum, and [MQTT-3.1.2-25] says it should discard the message and behave as if it was sent.

    maximumPacketSize is read from CONNECT, but today it's only applied to the reason string on SUBACK and on acks. It isn't applied to PUBLISH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:MQTTMQTT protocol supportenhancementNew feature or requestfrom-jiraMigrated or originated from a Jira ticket

    Type

    No type

    Fields

    Priority

    P2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions