Azure Service Bus Subscription filter not working

175 views Asked by At

I have some messages being post to service bus topic. Those messages have some custom properties embedded upon them and we wanted to put filter on the subscription created on that topic.

My properties were like this : event-type, event-sub-type

Notice the '-' character in the name of properties.

But my filter was just wasn't working at all. What could be reason behind it?

Wanted to create a subscription with filter rule but it didn't worked.

2

There are 2 answers

1
Vishal Sharma On

After scratching head for a good half day and trying atleast dozens of filter variation, I figured out that filters just wasn't working only because of '-' character in the property name.

The moment I changed "event-type" to "event_type", I started recieving message on that subscription.

Posting here, so it could save some of the time who could possibily end up into the same situation. Microsoft has been so generous and humble for not putting up any documentation on the custome property names ;)

0
Sean Feldman On

If you're using SQL filters and have custom properties with spaces or dashes, you need to enclose the property name within square brackets, as documented in the Arguments section of the SQL filter documentation.

For example

[my-property] = 'test'