Azure-Samples / service-bus-dotnet-management

MIT License
23 stars 14 forks source link

Serious Performance Issues #13

Open adamkjonesmesh opened 6 years ago

adamkjonesmesh commented 6 years ago

Hello,

We are experiencing significant latency when creating service bus topics using the ServiceBusManagementClient. I have some code below that you can reference. When using this library, creation of service bus subscriptions take an average of 10 seconds per. I have compared this with a full framework project using the WindowsAzure.ServiceBus package and the NamespaceManager. Within the full framework project, creation of service bus subscriptions take an average of 150ms per. The difference is staggering. I am seeking advice on a resolution.

Example Code To Create Service Bus Subscription using ServiceBusManagementClient

            var token = await GetToken();
            var creds = new TokenCredentials(token);
            var sbClient = new ServiceBusManagementClient(creds)
            {
                SubscriptionId = _cfg.SubscriptionId,
            };

            var subscriptionParams = new SBSubscription
            {
                MaxDeliveryCount = 10,
                AutoDeleteOnIdle = autoDeleteOnIdle,
                LockDuration = lockDuration
            };

            var sb = await sbClient.Subscriptions.CreateOrUpdateAsync(_cfg.ResourceGroupName, _cfg.NamespaceName, _topicName, subscriptionName, subscriptionParams);