mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Bridge config does not support spaces in topic names

Open baelter opened this issue 8 years ago • 6 comments

Even though they should not, topics can include spaces. Bridges configuration does not support this.

https://github.com/eclipse/mosquitto/blob/master/src/conf.c#L1551

Should use conf_parse_string?

baelter avatar Dec 26 '17 14:12 baelter

The topic directive has several parameters. How can we distinguish between a delimiter and a character of space?

toast-uz avatar Dec 29 '17 10:12 toast-uz

Allow escaped space? "%20" or "\ " or "+", or quoted names.

baelter avatar Jan 02 '18 12:01 baelter

Fails backward compatibility.

toast-uz avatar Jan 02 '18 13:01 toast-uz

You should not be backwards compatible with a bug

baelter avatar Jan 02 '18 13:01 baelter

I think it's not a bug, but a current spec of mosquitto.

The bridge topic of mosquitto cannot include spaces implicitly, because there are some delimiters in the directive (bridge) topic. The bridge feature purely depends on each implementation of broker because there is no description of bridge in the standard. Therefore, I'm afraid I think your insist is a little rough.

We have two options:

  1. Express this spec of the directive topic.
  2. Add new directive you wish to support a bridge topics include spaces and keep backward compatibility.

toast-uz avatar Jan 02 '18 13:01 toast-uz

Could it be possible to accept optional single quotes around the topic name in the bridge configuration?

Accepting all these examples?:

topic 'example/topic/with / spaces/#' in 0 "" "" topic example/topic/without/space/# in 0 "" "" topic 'example/topic/without/space/but/with/quotes/#' in 0 "" ""

Guzoft avatar Feb 13 '19 12:02 Guzoft