ManagementClient - Check if a rule exists on subscription
See original GitHub issueDescription
In service bus SDK, it would be nice to have a method, that would check if a named rule exists on the a service bus topic. There are rules which include GetRuleAsync
, UpdateRuleAsync
and UpdateRuleAsync
.
Actual Behavior
- To programmatically create/update/delete a subscription rule the relevant SDK methods are to be used. However, if the rule does not exist, the SDK raises
MessagingEntityNotFoundException
.
To check if a rule exists, a check as below needs to be done by an developer.
private static async Task<bool> RuleExistsAsync(
ManagementClient managementClient,
string topicPath,
string subscriptionName,
string ruleName)
{
// There is no method in the SDK to check if a particular rule exists.
try
{
if (await managementClient.GetRuleAsync
(topicPath, subscriptionName, ruleName) != null)
{
return false;
}
}
catch (MessagingEntityNotFoundException){}
return true;
}
Proposed Behavior
- Expose a method in the
ManagementClient
namedRuleExistsAsync
, similar toTopicExistsAsync
orSubscriptionExistsAsync
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ManagementClient Class
Checks whether a given rule exists or not for a given subscription. Boolean, subscriptionExists(String topicPath, String subscriptionName). Checks whether a ...
Read more >Azure Service Bus: How to correctly check if Subscription ...
I use a newly created Azure Service Bus in Basic Plan and newly (manually) created Queue. queueName has the value of an existing...
Read more >ManagementClient.SubscriptionExistsAsync Method
Checks whether a given subscription exists or not.
Read more >Managing IdM users, groups, hosts, and access control rules
You can verify if the new user account exists in IdM by using the ipa user-show command: Log into ipaserver as admin: $...
Read more >Content Management API
Contentful's Content Management API (CMA) helps you manage content in your spaces. To learn more about how to model your content, read our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ManagementClient
while exposing server-side options belongs to the client side SDK. You might want to move this issue to the SDK repo, replacing this one with an issue to provide a way on the broker to achieve this functionality.Hi @tpar. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “
/unresolve
” to remove the “issue-addressed” label and continue the conversation.