Skip to content

Add action-base concurrency limit support #19823

Closed
@wu-yafeng

Description

@wu-yafeng

I'm trying to limit concurrency request in my action OrdersController.Get but concurrency limiter middleware only support global.

Describe the solution you'd like

In controller

[ConcurrencyLimit(MaxConcurrentRequests=10)]
public ActionResult<Orders> Get()
{
}
[ConcurrencyLimit(Profile = "Profile")]
public ActionResult<Orders> Post()
{
}

In startup

public void ConfigureService(IServiceCollection services)
{
      services.AddControllers(options=>{
         options.ConcurrencyLimitProfile.Add("profile",new ConcurrencyLimitProfile());
      });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-mediumThis issue impacts approximately half of our customersarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresenhancementThis issue represents an ask for new feature or an enhancement to an existing oneseverity-minorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions