Skip to content

Handler for '#' should not be called for topics beginning with $ #728

@MattBrittan

Description

@MattBrittan

Section 4.7.2 of the MQTT 3.1 spec states:

The Server MUST NOT match Topic Filters starting with a wildcard character (# or +) with Topic Names beginning with a $ character

While this does not directly impact the client I think it's fair to expect that the callback for a Subscribe("#") should not be called when a $SYS/# message is received. Currently the callback is called in these cases.

This was raised in PR #721 but I feel that solution was probably incomplete (and could not be accepted due to lack of signed Eclipse Contributor Agreement) so that PR has been closed and I'm raising this issue so it's recorded as a TODO.

As the spec states "For a Client to receive messages from topics that begin with $SYS/ and from topics that don’t begin with a $, it has to subscribe to both “#” and “$SYS/#” it's probably better to check if either route or topic begin with $ and, if so, reject if both do not start with $).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions