public async Task <Microsoft.Azure.ServiceBus.IQueueClient> GetQueueClient() { var managementClient = new Microsoft.Azure.ServiceBus.Management.ManagementClient(_options.Value.ConnectionString); try { var queue = await managementClient.GetQueueAsync(_options.Value.QueueName); } catch (Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException) { await managementClient.CreateQueueAsync(new Microsoft.Azure.ServiceBus.Management.QueueDescription(_options.Value.QueueName) { EnablePartitioning = true }); } return(new Microsoft.Azure.ServiceBus.QueueClient(_options.Value.ConnectionString, _options.Value.QueueName)); }
internal void DeleteSubscription(string subscriptionName, string topicPath) { var client = new Microsoft.Azure.ServiceBus.Management.ManagementClient(asbConnectionString); client.DeleteSubscriptionAsync(topicPath, subscriptionName).Wait(); }