Filters
A filter is an expression, which might include wildcard characters, that is applied to the content of a publication message to determine whether it matches a subscription.
Filters are supported only if your application is using an MQ pub/sub broker; they are not supported by MQTT brokers.
- The message is a self-defining XML message.
- The message template is defined in the MQRFH2 header.
If the message has an MQRFH header, the message set and type are taken from that header. Otherwise, the message is assumed to be as defined in the properties (domain, set, type, and format) of the input node.
Body.Name LIKE 'Smit%'
This example means that the contents of a field called Name in the body of a publication message are extracted and compared with the string given in the expression. If the string in the message starts with the characters "Smit", the expression evaluates to TRUE and the publication is sent to the subscriber.
If you want to select publications using filters only, without specifying a topic, you can register a subscription with the required filter and a topic of "#" (all topics). You then receive publications on only those topics for which you have access authority.