Skip to content

The Throttle extension aborts pipeline processing when the CPU usage exceeds given percentage.

License

Notifications You must be signed in to change notification settings

Shuttle/Shuttle.Esb.Throttle

Repository files navigation

Throttle

PM> Install-Package Shuttle.Esb.Throttle

The Throttle module for Shuttle.Esb aborts pipeline processing when the CPU usage exceeds given percentage.

The module will attach the ThrottleObserver to the OnPipelineStarting event of the InboxMessagePipeline and abort the pipeline if the CPU usage exceeds the given percentage.

Configuration

services.AddThrottle(builder => 
{
	builder.Options.CpuUsagePercentage = 65;
	builder.Options.AbortCycleCount = 5;
	builder.Options.DurationToSleepOnAbort = new List<TimeSpan> { TimeSpan.FromSeconds(1) };
})

Options

Option Default Description
CpuUsagePercentage 65 The CPU usage percentage threshold to start throttling.
AbortCycleCount 5 The number of times a pipeline will be aborted before running at least once.
DurationToSleepOnAbort "00:00:01" The duration(s) to sleep when aborting a pipeline. Can be incremented for each abort.

About

The Throttle extension aborts pipeline processing when the CPU usage exceeds given percentage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages