Home > Software design >  What is the main difference between SQL filter and correlation filter in Azure Service Bus
What is the main difference between SQL filter and correlation filter in Azure Service Bus

Time:03-04

As explained in MSDN (https://docs.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?

CodePudding user response:

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

  • Correlation filters are intended to operation on a few system properties such as ContentType, MessageId, ReplyTo, ReplyToSessionId, SessionId, To, and CorrelationId. SQL filters are not constrained to system properties only and can operation on user/applicaiton properties/headers.
  • 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.
  • Related