0

I try to use postman to test how to send message to azure service bus specific subscription in a topic. I use sql filter to filter message, the SQL filter as below:

MsgClass = 'Good'

I input the below message use Json format which include MsgClass { "MsgClass":"Good", "DetailMessage": "DetailMessage,DetailMessage,DetailMessage" }

The post man send message successful to the topic but the message do not go to the subscription which have filter: MsgClass = 'Good',it go to the subscription which do not have any filter. So I am sure the SQL filter is not working.

Great appreciate for any suggestion how to do it by use PostMan.

Harly Chen
  • 33
  • 4

1 Answers1

1

SQL Filters only work on system properties or custom properties available on a message.

From this link:

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 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.

What you are expecting Azure Service Bus to filter on the data present in message body which is not the right usage of SQL Filters. This is why your filtering is not working.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241