@suvra jyotiThanks for reaching out. When it comes to filtering messages on the basis of entity ID in Service Bus, there are a few factors to consider in order to achieve near real-time delivery while minimizing the number of subscriptions and filters.
Based on the information you provided, it seems that you have 10,000 entities and you want to filter incoming messages on the basis of entity ID. One approach you could consider is using the IN operator in the CorrelationId filter to group entity IDs into sets of 5 or 10, as you suggested in your first approach. This would allow you to use a smaller number of subscriptions and filters while still being able to filter messages based on entity ID.
However, as you noted, there are limitations on the size of the filter expression when using the IN operator, and performance impact may become significant as the number of values increases. Therefore, you may want to consider breaking down the entity IDs into smaller groups and using multiple subscriptions and filters to handle them.
For example, you could group the entity IDs into sets of 100 or 200 and create multiple subscriptions and filters to handle each set. This would allow you to distribute the load across multiple subscriptions and filters while still being able to filter messages based on entity ID.
The best approach will depend on your specific requirements and constraints. You may want to consider testing different approaches and measuring their performance to determine which one works best for your use case.
do let me know incase of further queries, I would be happy to assist you.