Azure / azure-service-bus

☁️ Azure Service Bus service issue tracking and samples
https://azure.microsoft.com/services/service-bus
MIT License
585 stars 781 forks source link

Azure.Messaging.ServiceBus sample for subscription filters #469

Closed spelluru closed 2 years ago

spelluru commented 2 years ago

Description

We have a TopicFilters sample for the Track 1 package Microsoft.Azure.ServiceBus, but we don't have a similar one for Track 2 SDK. I have created this samples that creates the following entities and then sends and receives messages to test the filters on subscription.

1. A topic named `TopicFilterSampleTopic`.
2. Subscriptions to the above topic with the following settings. 

   | Subscription name |  Filter type |  Filter expression | Action | 
   | --------- | ----------- | ------------------ | ------ | 
   | AllOrders | True Rule filter | `1=1` | |
   | ColorBlueSize10Orders | SQL filter | `color = 'blue' AND quantity = 10` | | 
   | ColorRed | SQL filter | `color = 'red'` | `SET quantity = quantity / 2;REMOVE priority; SET sys.CorrelationId = 'low'`| 
   | ColorRed | Correlation filter | `"label": "red", "correlationId": "high"` | | 

This checklist is used to make sure that common guidelines for a pull request are followed.

spelluru commented 2 years ago

@EldertGrootenboer - Please review this new sample I created and merge when you get a chance. Thanks.

spelluru commented 2 years ago

@EldertGrootenboer