New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow . in mqtt topics #3482
Comments
@telemac To be sure I understand what you are saying:
If an inbound MQTT topic has a dot, say Whatever character that is used to replace the mqtt topic's '.' with may cause an issue when going from NATS to MQTT. For instance suppose we select the character "_" and assume that when going from MQTT to NATS we convert '.' with '.', then in example above it would become the NATS subject I don't see a solution that would work in both directions and be useable for NATS to MQTT (and vice versa) communication. I am opened to more suggestions, but there is a reason I originally did not support the |
Hi @kozlovic I was thinking of this kind of encoding : https://en.wikipedia.org/wiki/Percent-encoding So, the mqtt topic foo.bar/baz will become foo%2Ebar/baz in nats The problematic characters are encoded as %xx where xx is the ascii hex value. . is encoded as %2E It seems to me that this cloud solve the character collision problem between nats and mqtt. |
Sorry if that is a stupid question, but wouldn't it be possible to just replace EDIT: Ah, it seems like neither of the proposals is backwards compatible (in my case since |
RabbitMQ has the same problem and solves it with a specific sparkplug config option: https://www.rabbitmq.com/mqtt.html#sparkplug-support |
Is it possible to support to configure the subject/topic delimiter ( So just a possibility to switch between MQTT and NATS separators would be awesome. |
Yes we are considering for the 2.10 release. |
The `.` character will be transformed to `//` in NATS subject. For instance an MQTT message published on `spBv1.0/plant1` would be received by a NATS subscriber as `spBv1//0.plant1`. Conversely, a NATS message published on `spBv1//0.plant1` would be received by an MQTT subscriber as `spBv1.0/plant1`. Resolves #1879 Resolves #3482 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
The `.` character will be transformed to `//` in NATS subject. For instance an MQTT message published on `spBv1.0/plant1` would be received by a NATS subscriber as `spBv1//0.plant1`. Conversely, a NATS message published on `spBv1//0.plant1` would be received by an MQTT subscriber as `spBv1.0/plant1`. Resolves #1879 Resolves #3482 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This will now be supported in 2.10. Thanks for raising this! |
Feature Request
Use Case:
Allow nats mqtt server to be used with spark plug B :
Sparkplug B specifications
Sparkplug uses spBv1.0 as topic prefix.
Proposed Change:
Who Benefits From The Change(s)?
Alternative Approaches
Allow the use of / as separator in NATS, to harmonize the NATS and MQTT topics.
The text was updated successfully, but these errors were encountered: