question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ManagementClient - Check if a rule exists on subscription

See original GitHub issue

Description

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

  1. 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

  1. Expose a method in the ManagementClient named RuleExistsAsync, similar to TopicExistsAsync or SubscriptionExistsAsync.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SeanFeldmancommented, Feb 24, 2020

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.

0reactions
msftbot[bot]commented, Aug 25, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found