Boolean Filters |
SQL Filters |
Correlation Filter |
The TrueFilter and FalseFilter either cause all arriving messages (true) or none of the arriving messages (false) to be selected for the subscription.
|
A SqlFilter holds a SQL-like conditional expression that is
evaluated in the broker against the arriving messages' user-defined
properties and system properties. All system properties must be prefixed with
sys. in the
conditional expression. The SQL-language subset for filter conditions tests for
the existence of properties (EXISTS ), as well as for null-values (IS NULL ), logical
NOT/AND/OR, relational operators, simple numeric arithmetic, and simple text
pattern matching with LIKE . |
A CorrelationFilter holds a set
of conditions that are matched against one or more of an arriving message's
user and system properties. A common use is to match against the CorrelationIdproperty, but the application can also choose to match
against ContentType, Label, MessageId, ReplyTo, ReplyToSessionId, SessionId, To, and any user-defined properties. A match exists when an
arriving message's value for a property is equal to the value specified in
the correlation filter. For string expressions, the comparison is
case-sensitive. When specifying multiple match properties, the filter
combines them as a logical AND condition, meaning for the filter to match,
all conditions must match.
|
Use of SQL Filter rules
results in lower overall message throughput at the subscription, topic, and
namespace level.
|
Whenever possible,
applications should choose correlation filters over SQL-like filters, since
they are much more efficient in processing and therefore have less impact on
throughput.
|
|
With SQL filter
conditions, you can define an action that can annotate the message by adding,
removing, or replacing properties and their values. The action uses a SQL-like expression that loosely leans on the SQL UPDATE statement
syntax. The action is performed on the message after it has been matched and
before the message is selected into the subscription. The changes to the
message properties are private to the message copied into the subscription.
|
Subscribers can define which messages they want to receive from a
topic. These messages are specified in the form of one or more named
subscription rules. Each rule consists of a condition that selects particular
messages and an action that annotates the selected message. For each matching
rule condition, the subscription produces a copy of the message, which may be
differently annotated for each matching rule.
Each newly created topic subscription has an initial default
subscription rule. If you don't explicitly specify a filter condition for the
rule, the applied filter is the true filter that
enables all messages to be selected into the subscription.
All filters evaluate message properties. Filters
cannot evaluate the message body.