I am trying to improve bandwidth in a Windows service using Azure Service Bus. I noticed that if I have code like this.
client.OnMessageAsync(async message => { var timer = new Stopwatch(); timer.Start(); bool shouldAbandon = false; try { // asynchronouse processing of messages await messageProcessor.ProcessAsync(message); Interlocked.Increment(ref SimpleCounter); // complete if successful processing await message.CompleteAsync(); } catch (Exception ex) { shouldAbandon = true; Console.WriteLine(ex); } if (shouldAbandon) { await message.AbandonAsync(); } timer.Stop(); messageTimes.Add(timer.ElapsedMilliseconds); }, options);
If the parameters
OnMessageOptions options = new OnMessageOptions { MaxConcurrentCalls = maxConcurrent, AutoComplete = false };
Increasing MaxConcurrentCalls has little effect on a certain number (usually 12-16 for what I do).
But creating multiple clients (QueueClient) using the same MaxConcurrentCalls improves performance (almost linearly).
So what I'm doing is configuring #queueclient and maxconcurrentcalls, but I'm wondering if the best approach is to work with multiple queueclients.
So my question is: does there have multiple queueclients with messages with bad or good practice for windows service and azure service bus?
, , , .
, . , .
, , MaxConcurrency , Service Bus - , ( 1 ), .
MaxConcurrency
, , , MaxConcurrency 2x/3x/4x , - , , . MaxConcurrency - , .
, . , , , MaxConcurrency, , , - .
, , "" , MaxConcurrency, , .
Source: https://habr.com/ru/post/1648180/More articles:C - Avoiding diacritic / accent issues - cApplication prints "Listening to dt_socket transport at address: 5005" and does not stop - javaHow to get action url without parameters in ASP.NET MVC - c #Постройте радио-группу <ионный список> с ngFor - ionic2D3.js, how to go in the opposite direction with the basic elements of SVG - css-transitionsPHP Fpm process kills my site: the process is blocked by D status - linuxAngular 2 and Webpack lazy loading - angularHow to deploy Polymer CLI app on Apache web server? - apacheJSON Providing in Phoenix - elixirClojure spec nesting map nested value - clojureAll Articles