Skip to content

Commit 7931e9b

Browse files
authored
Merge pull request #111651 from spelluru/sbusfilters0416
added links to samples
2 parents fe3782a + e80a595 commit 7931e9b

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

articles/service-bus-messaging/topic-filters.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ title: Azure Service Bus topic filters | Microsoft Docs
33
description: This article explains how subscribers can define which messages they want to receive from a topic by specifying filters.
44
services: service-bus-messaging
55
documentationcenter: ''
6-
author: clemensv
7-
manager: timlt
6+
author: spelluru
87
editor: ''
98

109
ms.service: service-bus-messaging
1110
ms.workload: na
1211
ms.tgt_pltfrm: na
1312
ms.devlang: na
14-
ms.topic: article
15-
ms.date: 01/27/2020
13+
ms.topic: conceptual
14+
ms.date: 04/16/2020
1615
ms.author: spelluru
1716

1817
---
@@ -27,17 +26,28 @@ Service Bus supports three filter conditions:
2726

2827
- *Boolean filters* - The **TrueFilter** and **FalseFilter** either cause all arriving messages (**true**) or none of the arriving messages (**false**) to be selected for the subscription.
2928

30-
- *SQL Filters* - 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](service-bus-messaging-sql-filter.md) 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`.
29+
- *SQL Filters* - 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](service-bus-messaging-sql-filter.md) tests for the existence of properties (`EXISTS`), null-values (`IS NULL`), logical NOT/AND/OR, relational operators, simple numeric arithmetic, and simple text pattern matching with `LIKE`.
3130

32-
- *Correlation Filters* - 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 **CorrelationId** property, 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.
31+
- *Correlation Filters* - 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 **CorrelationId** property, but the application can also choose to match against the following properties:
3332

34-
All filters evaluate message properties. Filters cannot evaluate the message body.
33+
- **ContentType**
34+
- **Label**
35+
- **MessageId**
36+
- **ReplyTo**
37+
- **ReplyToSessionId**
38+
- **SessionId**
39+
- **To**
40+
- any user-defined properties.
41+
42+
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.
3543

36-
Complex filter rules require processing capacity. In particular, the 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.
44+
All filters evaluate message properties. Filters can't evaluate the message body.
45+
46+
Complex filter rules require processing capacity. In particular, the use of SQL filter rules cause lower overall message throughput at the subscription, topic, and namespace level. Whenever possible, applications should choose correlation filters over SQL-like filters because they're much more efficient in processing and have less impact on throughput.
3747

3848
## Actions
3949

40-
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](service-bus-messaging-sql-filter.md) 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.
50+
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](service-bus-messaging-sql-filter.md) that loosely leans on the SQL UPDATE statement syntax. The action is done 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.
4151

4252
## Usage patterns
4353

@@ -49,10 +59,17 @@ Partitioning uses filters to distribute messages across several existing topic s
4959

5060
Routing uses filters to distribute messages across topic subscriptions in a predictable fashion, but not necessarily exclusive. In conjunction with the [auto forwarding](service-bus-auto-forwarding.md) feature, topic filters can be used to create complex routing graphs within a Service Bus namespace for message distribution within an Azure region. With Azure Functions or Azure Logic Apps acting as a bridge between Azure Service Bus namespaces, you can create complex global topologies with direct integration into line-of-business applications.
5161

62+
63+
> [!NOTE]
64+
> Currently the Azure portal doesn't let you specify filter rules for subscriptions. You can use any of the supported SDKs or Azure Resource Manager templates to define subscription rules.
65+
5266
## Next steps
67+
See the following samples:
68+
69+
- [.NET - Basic send and receive tutorial with filters](https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/GettingStarted/BasicSendReceiveTutorialwithFilters/BasicSendReceiveTutorialWithFilters)
70+
- [.NET - Topic filters](https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/Microsoft.Azure.ServiceBus/TopicFilters)
71+
- [JavaScript](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/samples/javascript/advanced/topicFilters.js)
72+
- [Type script](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/samples/typescript/src/advanced/topicFilters.ts)
73+
- [Azure Resource Manager template](https://docs.microsoft.com/azure/templates/microsoft.servicebus/2017-04-01/namespaces/topics/subscriptions/rules)
5374

54-
To learn more about Service Bus messaging, see the following topics:
5575

56-
* [Service Bus queues, topics, and subscriptions](service-bus-queues-topics-subscriptions.md)
57-
* [SQLFilter syntax](service-bus-messaging-sql-filter.md)
58-
* [How to use Service Bus topics and subscriptions](service-bus-dotnet-how-to-use-topics-subscriptions.md)

0 commit comments

Comments
 (0)