mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
886 B
25 lines
886 B
using System.Threading.Tasks;
|
|
using Azure.Messaging.ServiceBus.Administration;
|
|
|
|
namespace Volo.Abp.AzureServiceBus
|
|
{
|
|
public static class ServiceBusAdministrationClientExtensions
|
|
{
|
|
public static async Task SetupTopicAsync(this ServiceBusAdministrationClient client, string topicName)
|
|
{
|
|
if (!await client.TopicExistsAsync(topicName))
|
|
{
|
|
await client.CreateTopicAsync(topicName);
|
|
}
|
|
}
|
|
|
|
public static async Task SetupSubscriptionAsync(this ServiceBusAdministrationClient client, string topicName, string subscriptionName)
|
|
{
|
|
await client.SetupTopicAsync(topicName);
|
|
if (!await client.SubscriptionExistsAsync(topicName, subscriptionName))
|
|
{
|
|
await client.CreateSubscriptionAsync(topicName, subscriptionName);
|
|
}
|
|
}
|
|
}
|
|
}
|