Skip to content

Wildcards ​

Wildcards let one subscription match many topics. They work on every ConnectMQ plan and are the reason a well-structured topic tree is so useful.

Single level: + ​

+ matches exactly one topic level, anywhere in the filter.

Filter acme/istanbul/+/line1/+/telemetry
acme/istanbul/assembly/line1/cnc-01/telemetryMatches
acme/istanbul/painting/line1/robot-02/telemetryMatches
acme/istanbul/assembly/line1/cnc-01/statusNo: different last level
acme/istanbul/assembly/line1/cell-a/cnc-01/telemetryNo: one level too many

Multi level: # ​

# matches the current level and everything below it. It must be the last character of the filter.

Filter acme/istanbul/assembly/#
acme/istanbul/assembly/line1/cnc-01/telemetryMatches
acme/istanbul/assembly/line2/press-04/alarmsMatches
acme/istanbul/assemblyMatches (the parent level itself)
acme/izmir/assembly/line1/cnc-01/telemetryNo: different site

Useful filters for an ISA-95 tree ​

You wantFilter
Everything of one siteacme/istanbul/#
Everything of one lineacme/istanbul/assembly/line1/#
Telemetry of every machineacme/+/+/+/+/telemetry
Status of every machine on one lineacme/istanbul/assembly/line1/+/status
Everything in your organization#

Rules ​

  • Wildcards are only for subscribing; a publish to a topic containing + or # is invalid.
  • + and # must fill a whole level: line+/temp or temp# are invalid.
  • # does not match system topics that start with $, such as $SYS/...; subscribe to those explicitly.
  • A subscription to # returns only your organization's topics, but it can still be a lot of traffic. Subscribe to the branches you need.
  • Each filter counts once towards your plan's subscriptions per client (limits), however many topics it matches. Prefer one wildcard to many single topics.
  • On the public test broker, a wildcard in the first level (#, +/…) is refused with 0x87 Not authorized; use your own prefix, for example connectmq/demo/7f3a91/#.

Wildcards and access control ​

ACL rules use the same syntax. A subscription is allowed only if a rule's filter covers the whole requested filter: with an allow rule on acme/istanbul/#, a client may subscribe to acme/istanbul/assembly/# but not to acme/#. A refused subscription gets 0x87 Not authorized in the SUBACK.

Fully managed MQTT broker for connected devices.