opendxl / opendxl-broker

OpenDXL Broker is an open source version of a Data Exchange Layer (DXL) broker
Apache License 2.0
13 stars 14 forks source link

Is "+" single level wild cards supported in broker just not client tested? #8

Closed shadowbq closed 5 years ago

shadowbq commented 5 years ago

Documentation seem to say single level is not supported or implemented.

Docs say: Full topic wildcarding | MQTT yes | DXL no (only supports multi-level, single-level may be added pending performance improvements)

Single Level: + As the name suggests, a single-level wildcard replaces one topic level. The plus symbol represents a single-level wildcard in a topic.

https://github.com/opendxl/opendxl-broker/blob/0.2.2/src/mqtt-core/src/subs.c#L374 https://github.com/opendxl/opendxl-broker/blob/0.2.2/src/mqtt-core/src/subs.c#L492

    // Determine whether topic is a wild card and set it appropriately for searching
    if(topic_is_wild_card(branch->topic, "#")) subhier->hash_table_has_pound_wild_card++;
    if(topic_is_wild_card(branch->topic, "+")) subhier->hash_table_has_plus_wild_card++;
chrissmith-mcafee commented 5 years ago

No, it is not supported for the broker or clients at this time.

Some of the code to support single-level wildcards is present, but it has some limitations and issues which is why it is not exposed by the clients currently.

For example, authorization does not support single-level wildcards. Once the remaining issues are resolved and we can obtain adequate performance we will enable support in the clients.