how do I filter Azure Service Bus Queue messages based on a message property?
azure, c#, servicebus
Solution
Queues are generally not a good fit for querying and advanced filtering scenarios. Peeking through a large queue when a customer checks for status would defeat the whole purpose of using a service bus.
My suggestion is to store the status of started tasks in Azure table storage. Once worker role processes or fails processing a message in the queue, it could simply update the status in the table storage.
Problem
I am using Azure Service Bus Queue to send emails out from my app. I have many different customers that send out emails via my app and each message gets a property that identifies that customer: CustomerID I need to write an admin area for my customers to look at the pending message in the queue and more importantly see the deadletter queue. I do not want them to see everyones deadletters so I want to filter the messages based on the property CompanyID. How do I accomplish this? I read about topics and subscriptions but I add 10+ customers a week at least and this would not be a reasonable solution for me.