IoT Edge Connect API supports the following topic filters:
-
Regular topic filter. Defines a specific line of communication. All authorized users and devices can subscribe and publish to the topic it represents. In an ACL configuration, a topic filter is defined by an absolute path. For example,
company/model/year/version/
. -
Device identity topic filter. Defines the only devices that can subscribe or publish to the topic it represents. In an ACL configuration, a device topic filter is defined by a path including
%c
that represents a single topic level and is a replacement for a client identifier. Only the devices with matching client identifiers can publish or subscribe to topics represented by such topic filters. For example, with this topic filtercompany/model/%c/version
, the only devices that can publish or subscribe to thecompany/model/ABC123/version
topic must have theABC123
client identifier. -
User identity topic filter. Defines the only users who can subscribe or publish to the topic it represents. In an ACL configuration, a user identity topic filter is defined by a path including
%u
that represents a topic level and is a replacement for a user identifier. Only the users with matching user identifiers can publish or subscribe to topics represented by such topic filters. By default, devices belonging to one user have different client identifiers but share the same user identifier. By publishing a message to a topic represented by a user identity filter, a message is delivered to all devices sharing this particular user identifier. For example, with this topic filtercompany/model/%u/version
, the only users that can publish or subscribe to thecompany/model/ABC123/version
topic must have theABC123
user identifier. Also, all devices that share theABC123
user identifier can read a message from this topic.
Topic filter wildcards
You can use the following wildcards in a topic filter to broaden the range of topics that it represents:
-
#
. Use this multi level wildcard to match the parent and any number of child topic levels. You can use it either on its own or after a level separator/
. It must be the last character in the path. For example, this topic filtercompany/model/year/#
may represent these topics:company/model/year/version
orcompany/model/year/user/price
. -
+
. Use this one-level wildcard to match a specific topic level. You can also use it at more than one topic level and together with the multi level wildcard. For example, this topic filter+/company/+/year/#
may represent these topics:network/company/campaign/year/version
orcountry/company/industry/year/software/price
.