如何在Microsoft.Azure.ServiceBus 2.0.0中验证TopicName和SubscriptionName [英] How to validate TopicName and SubscriptionName in Microsoft.Azure.ServiceBus 2.0.0

查看:97
本文介绍了如何在Microsoft.Azure.ServiceBus 2.0.0中验证TopicName和SubscriptionName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写测试用例以在C#中使用主题名称和订阅名称配置Microsoft.Azure.ServiceBus。

虽然我提供了错误的输入,但测试用例正在通过。如何查看主题名称或订阅名称


是否存在。

I am writing test cases to Configure Microsoft.Azure.ServiceBus with Topic Name and Subscription Name in C#.
The test case is passing although I am providing wrong inputs. How can I check if Topic Name or Subscription Name
exists or not.

您能否尽快帮助我们。

推荐答案

您好Aniruddha Kumbhar,

Hi Aniruddha Kumbhar,

感谢您在此发帖。

对于您的问题,请尝试使用TopicExists(String)方法检查服务命名空间中是否存在主题,并使用SubscriptionExists(String,String)方法来确定服务命名空间中是否存在订阅。

For your question, try to use TopicExists(String) Method to check whether a topic exists in the service namespace and use SubscriptionExists(String, String) Method to dtermine whether a subscription exists in the service namespace.

有关详细信息,请参阅msdn文档。

For more details, please refer to the msdn documents.

TopicExists(字符串)方法

https: //docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.namespacemanager.topicexists?view=azure-dotnet#Microsoft_ServiceBus_NamespaceManager_Topic Exists_System_String_

SubscriptionExists(字符串,字符串)方法

https:// docs。 microsoft.com/en-us/dotnet/api/microsoft.servicebus.namespacemanager.subscriptionexists?view=azure-dotnet

最诚挚的问候,

Wendy


这篇关于如何在Microsoft.Azure.ServiceBus 2.0.0中验证TopicName和SubscriptionName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆