Search code examples
azureazureservicebusazure-servicebus-topicsazure-servicebus-subscriptions

What is the main difference between SQL filter and correlation filter in Azure Service Bus


As explained in MSDN (https://learn.microsoft.com/en-us/azure/service-bus-messaging/topic-filters) SQL Filter and Correlation Filter both uses message's system defined and user defined properties.

Can you please provide an example to show the difference among both?


Solution

  • I have a blog post where all three filter types are explained

    1. Boolean filters
    2. Correlation filters
    3. SQL filters

    There are several differences between correlation and SQL filters. Just to list a few

    • Within a correlation filter, multiple conditions are AND-ed. SQL filter is much more flexible and can use AND as well as OR operations.
    • The cost of evaluating filter expression is minimal and almost immediate w/o extra compute required. SQL filters can require more compute but offer more flexibility.