Skip to content

Add configuration for broker to allow clients to publish to '$' topics#314

Open
LukasWoodtli wants to merge 1 commit into
Yakifo:mainfrom
husqvarnagroup:gardena/lw/allow_dollar
Open

Add configuration for broker to allow clients to publish to '$' topics#314
LukasWoodtli wants to merge 1 commit into
Yakifo:mainfrom
husqvarnagroup:gardena/lw/allow_dollar

Conversation

@LukasWoodtli

Copy link
Copy Markdown

Changes included in this PR

Add configuration to allow a broker to accept messages published to a topic starting with a dollar sign ($).

Current behavior

Currently, a client is not allowed to publish on topics that start with a dollar sign. This was introduced by #245.

New behavior

Now a configuration is added to allow clients to publish to dollar topics.

Impact

The new configuration is disabled by default. So the current behavior stays as long as the user doesn't change it.

Checklist

  1. Does your submission pass the existing tests?
  2. Are there new tests that cover these additions/changes?
  3. Have you linted your code locally before submission?

@LukasWoodtli LukasWoodtli force-pushed the gardena/lw/allow_dollar branch from b2f92bc to 731c417 Compare June 15, 2026 19:25
@ajmirsky

Copy link
Copy Markdown
Collaborator

@LukasWoodtli Thanks for contributing to the project! Per my read of the mqtt 3.1.1 spec, receiving $ topics is not allowed, configuration or otherwise.

https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718108

Do you read it differently? I'm hesitant to provide an option that makes the broker/client configurable to be non-compliant. Can you share with me your use case? I'm sure there is a valid use case. I will review and see if I can help find an alternate implementation where we can maintain compliance and still allow your use case.

ajmirsky added a commit to ajmirsky/amqtt that referenced this pull request Jun 24, 2026
@ajmirsky

Copy link
Copy Markdown
Collaborator

@LukasWoodtli

would this meet your needs? it would enable your use case without adding something that doesn't comply with the MQTT spec:

https://github.com/ajmirsky/amqtt/blob/feat/allow_dollar_topics/samples/broker_dollar_topics.py

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