Presently, NServiceBus offers very limited capability to rate-limit message processing. Probably the most commonly used API is LimitMessageProcessingConcurrencyTo which restricts the number of messages that can be handled concurrently. This is the only (*) setting that directly affects how the transport invokes the core.
With the introduction of the new Rate-Limiting APIs for .NET System.Threading.RateLimiting which has net462, net6.0, net7.0, and netstandard2.0 assemblies it would be possible to have more sophisticated concurrency and rate-limiting control.
It would be great to experiment ways to get better integration with those APIs. For example providing downstream integration into those APIs in the transports, create a core seam that allows to pass RateLimitingPolicies/Options similar to the ASP.NET Core middleware that then is passed to the transport seam or just create samples
(*) Not entirely true since we also have the possibility now to go from N to 1 with the sequential processing
Presently, NServiceBus offers very limited capability to rate-limit message processing. Probably the most commonly used API is
LimitMessageProcessingConcurrencyTo
which restricts the number of messages that can be handled concurrently. This is the only (*) setting that directly affects how the transport invokes the core.For more advanced throttling, we have provided a sample
With the introduction of the new Rate-Limiting APIs for .NET
System.Threading.RateLimiting
which has net462, net6.0, net7.0, and netstandard2.0 assemblies it would be possible to have more sophisticated concurrency and rate-limiting control.It would be great to experiment ways to get better integration with those APIs. For example providing downstream integration into those APIs in the transports, create a core seam that allows to pass RateLimitingPolicies/Options similar to the ASP.NET Core middleware that then is passed to the transport seam or just create samples
(*) Not entirely true since we also have the possibility now to go from N to 1 with the sequential processing