Neo
Neo

Reputation: 16219

How to create a filter on service bus topic subscription on message property?

I have one topic DemoTopic and having 2 subscriptions 'sub1' and sub2

my message payload is like this

{
   "data": [
            {
                "id": "1",
                "name": "a",
                "pid": "p1"
            },
            {
                "id": "2",
                "name": "b",
                "pid": "p2"
            },
            {
                "id": "3",
                "name": "c",
                "pid": "p3"
            }
            ]
}

if pid value is p1 and p2 then send messsage to sub1

how to create a filter for this using p1 and p2 value?

Upvotes: 0

Views: 952

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 25994

Subscriptions can only filter messages on some system properties and user/custom properties (aka headers). If your message contains the data required for filtering, you should promote those property values to the headers when dispatching messages.

Upvotes: 1

Related Questions